[Zope3-dev] XML header and TAL interpretor

Julien Anguenot ja at nuxeo.com
Wed Aug 31 07:37:39 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

I got a problem with the standard macros use and the XML header.

I've a view defined like the one below :

<?xml version="1.0" encoding="UTF-8"?>
<html
    xmlns:tal="http://xml.zope.org/namespaces/tal"
    xmlns:metal="http://xml.zope.org/namespaces/metal"
    >
  <body metal:use-macro="context/@@standard_macros/page">
    <!-- content -->
  </body>
</html>

And there, I got the following error when Zope's trying to render it :

- -----
2005-08-31T13:21:56 ERROR SiteError
http://localhost:8080/+/addBar.html%3Dbar
Traceback (most recent call last):
  File "/home/zopes/Zope-3_ECM/src/zope/publisher/publish.py", line 138,
in publish
    result = publication.callObject(request, object)
  File
"/home/zopes/Zope-3_ECM/src/zope/app/publication/zopepublication.py",
line 164, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  File "/home/zopes/Zope-3_ECM/src/zope/publisher/publish.py", line 113,
in mapply
    return debug_call(object, args)
  File "/home/zopes/Zope-3_ECM/src/zope/publisher/publish.py", line 119,
in debug_call
    return object(*args)
  File
"/home/zopes/Zope-3_ECM/src/zope/app/pagetemplate/simpleviewclass.py",
line 44, in __call__
    return self.index(*args, **kw)
  File
"/home/zopes/Zope-3_ECM/src/zope/app/pagetemplate/viewpagetemplatefile.py",
line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File
"/home/zopes/Zope-3_ECM/src/zope/app/pagetemplate/viewpagetemplatefile.py",
line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/zopes/Zope-3_ECM/src/zope/pagetemplate/pagetemplate.py",
line 117, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/zopes/Zope-3_ECM/src/zope/tal/talinterpreter.py", line
270, in __call__
    self.interpret(self.program)
  File "/home/zopes/Zope-3_ECM/src/zope/tal/talinterpreter.py", line
345, in interpret
    handlers[opcode](self, args)
  File "/home/zopes/Zope-3_ECM/src/zope/tal/talinterpreter.py", line
887, in do_useMacro
    (`macroName`, `mode`), self.position)
METALError: macro u'context/@@standard_macros/page' has incompatible
mode 'html', at line 6, column 3

If I remove the xml header the error disappears.

It's really a huge problem because it means Zope3 'as it' can't render
valid XML pages with standard macros...

Any idea how to fix thix problem without having to rewrite the standard
macros ?

My use case is the inclusion of XForms within the Page Template and the
mozilla plugin requires the page to be XML valid and thus to have the
xml header.

Any hints welcome.

	J.


- --
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM   : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDFZaDGhoG8MxZ/pIRAm9YAJ4uVr/IrXuVeRr1jlVyU4RQJ+IzIgCfQrRF
gH79PuOE0yu2qppa+xykwUE=
=XWiD
-----END PGP SIGNATURE-----


More information about the Zope3-dev mailing list