[Zope3-dev] Re: XML header and TAL interpretor
Julien Anguenot
ja at nuxeo.com
Wed Aug 31 08:57:04 EDT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Philipp von Weitershausen wrote:
> Julien Anguenot wrote:
>
>>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 :
>>[snip]
>> (`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 sucks, don't it?
big time yeah...
>
>
>>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.
>
>
[...]
> So, instead of proposing to radically get rid of HTML4 mode, I propose this:
>
> - XML mode of ZPT becomes the standard mode.
+1
>
> - We keep HTML4 mode around as long people need it, but it's not the
> standard mode. The switch whether to use XML or HTML4 mode is done via
> ZCML and not some sniffing in the PageTemplate contents.
I don't have any opinion on this.
>
> Yes, I realize that this will suddenly introduce the requirement that
> all templates need to carry namespace declarations.
That's not a problem.
> I think that's a
> good thing. They're not dead chickens. Namespace declarations are
> meaningful and useful and they're what XML-capable people and tools are
> used to. To sum it up: it's the spec. I've always found it much harder
> to explain why Zope wouldn't support the spec in this or that particular
> case than just sticking with the spec in such cases.
clearly.
>
> I would be willing to work this out as a full-blown proposal together
> with Julien.
great !
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
iD8DBQFDFakfGhoG8MxZ/pIRAmJ9AJ47mCTNwIBx62Vq0hekv4kB/WAa6ACeLhoh
svXXo+MgmusOVhrFmmIiblM=
=K9kd
-----END PGP SIGNATURE-----
More information about the Zope3-dev
mailing list