[ZPT] ExpatError in FS-View but not in ZopeFolder

Christian Ledermann lists at futuresign.de
Fri Oct 22 16:12:34 EDT 2004


A Pagetemplate that is placed in a _Filesystem Directory View_ gives the
error:

<!-- Page Template Diagnostics
 Compilation failed
 xml.parsers.expat.ExpatError: junk after document element: line 8, column 0
-->

If I try to customize it the error remains.

If I just copy the code (with cut and paste) to a _new_ PageTemplate in a Zope Folder
everthing works fine, no errors.

My first thought was that there was an illegal char that did not display somewhere, 
but this was not the case, the only invisible chars are LineFeeds. 

the code of the page template is:
-----------------
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE xbel
  PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
         "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/xml')"/>

<xbel version="1.0"  tal:define="rootLevel python:here.getFolderListingFolderContents(suppressHiddenFiles=1)" >

    <title tal:content="here/title">The title</title>
    <desc tal:content="here/description"> The description </desc>
    <tal:block metal:use-macro="here/xbelListing/macros/level"/>

</xbel>
------------------------

am I missing some important point here?

just for completeness or if you want to reproduce the error here is the
code for the xbelListing pagetemplate, which runs just fine:
----------------------
<tal:entry metal:define-macro="level"
    tal:condition="rootLevel">

             <tal:entry tal:repeat="level rootLevel">
                 <folder folded="yes" tal:condition="python: level.portal_type in ['BookmarkFolder', 'bookmark_folder']"
                            tal:attributes="id level/id">
                        <title tal:content="level/title_or_id"> the folder title </title>
                        <desc tal:content=" python:test(level.Description(), level.Description(), 'n/a')"> The folder description </desc>
  
                          <tal:block tal:define="rootLevel python:level.getFolderListingFolderContents(suppressHiddenFiles=1);
                                                 ">
                           <tal:block metal:use-macro="here/xbelListing/macros/level"/>
                          </tal:block>
   
                  </folder>
                  <bookmark id="xbel" href="http://www.python.org/topics/xml/xbel/"
                        tal:condition="python: level.portal_type in ['Link', 'Favorite']"
                        tal:attributes="id level/id; href level/getRemoteUrl;"
                        >
                        <title tal:content="level/title_or_id"> the bookmark title </title>
                        <desc tal:content=" python:test(level.Description(), level.Description(), 'n/a')"> The bookmark description </desc>
                  </bookmark>

             </tal:entry> 
</tal:entry> 

-----------------------

I recieved one feedback so far saying that this can be reproduced:

> Q: can you reproduce the above?
> 
> Yes, I could reproduce by placing a NEW page template in the custom folder,
> and then I didn't get the error. I'm just as bewildered as you are. I turned
> on invisible characters in BBEdit to see if I could find an offending
> character, and did a diff between the FS version and the new version, and
> they were identical.

I am 404, is this a bug in ZPT / Expat or just some silly obvious point 
I am missing here

thx 
christian



More information about the ZPT mailing list