[Zope3-dev] Page Template Bug??

Darryl Cousins darryl at darrylcousins.net.nz
Tue Aug 7 21:43:05 EDT 2007


Hi,

On Wed, 2007-08-08 at 00:39 +0200, Luis De la Parra wrote:
> 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>
> ============================================================

Perhaps try breaking the string:

	var tpl = "<" + "div> js-template <" + "/div>"

Or something like that. Probably zpt doesn't know about tags within
javascript strings.

Disclaimer: I've never used ExtJS.

Regards,
Darryl

> 
> regards, luis
> 
> 
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: http://mail.zope.org/mailman/options/zope3-dev/darryl%40darrylcousins.net.nz



More information about the Zope3-dev mailing list