[Zope3-dev] Page Template Bug??

Luis De la Parra lparrab at gmx.net
Tue Aug 7 18:39:58 EDT 2007


Hello all,

I just decided to give ExtJS a try, and while taking a look at
their "javascript templates", I think I found a bug in the template parsing
of zope:

trying to access a page that just serves the template below, fails with the
message:

========error msg===========
[...]zope.pagetemplate-3.4.0a1-py2.4.egg/zope/pagetemplate/pagetemplate.py",
line 109, in pt_render
   - Warning: Compilation failed
   - Warning: zope.tal.htmltalparser.NestingError: Open tags <html>, <body>,
<script> do not match close tag </div>, at line 12, column 35
PTRuntimeError: ['Compilation failed', 'zope.tal.htmltalparser.NestingError:
Open tags <html>, <body>, <script> do not match close tag </div>, at line
12, column 35']
=============================

it seems like the parser sees the closing </div>, but misses the opening
one.
I tried commenting out <!-- --> the script contents, but got the same
problem. (If I comment the script tag as a whole, then the page gets
served, but that doesn't bring me anything =(  )


======================== test.pt ===========================
<html>
        <head>
                <script src="../static/ext-base.js" type="text/javascript"
tal:attributes="src static/ext-base.js"></script> 
                <script src="../static/ext-all-debug.js" type="text/javascript"
tal:attributes="src static/ext-all-debug.js"></script>
        </head>
        <body>
        ExtJS Test
 
        <div id="testid">this is a test</div>  
        
        <script language="JavaScript">
             var tpl  = "<div> js-template </div>"
             var view = new Ext.JsonView("testid", tpl);        
        </script>  
</body>
</html>
============================================================

regards, luis




More information about the Zope3-dev mailing list