[Zope3-dev] Re: XML header and TAL interpretor

Philipp von Weitershausen philipp at weitershausen.de
Wed Aug 31 09:54:45 EDT 2005


Julien Anguenot wrote:
> Ok the problem is the doctype declaration on top of the macro files that
> force the tal interpretor to enter html mode and as far as I understand
> you can't have mix moded macros.

Exactly. I forgot to mention that in my follow-up...

Btw, doctype declaration is something else. You probably just mean the
XML processing instruction.

> If you change the doctype declaration with the xml header and add the
> xmlns declaration for tal, metal and i18n then everything's fine after.
> 
> See for instance the navigation macros :
> 
> http://svn.zope.org/Zope3/trunk/src/zope/app/rotterdam/navigation_macros.pt?rev=28163&view=auto
> 
> If you change the header like this then it can be succesfully included :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:tal="http://xml.zope.org/namespaces/tal"
>       xmlns:metal="http://xml.zope.org/namespaces/metal"
>       xmlns:i18n="http://xml.zope.org/namespaces/i18n"
>       i18n:domain="zope">
> <body>
> 
> What kind of issue could we have changing the headers like this on all
> the standard macros since it's xhtml already ?

I'm not sure if this is a good idea. Because once Zope3's macros are XML
mode, all other templates using those macros need to be XML mode. That,
in turn, means that all templates need to carry the <?xml ...?>
processing instruction because that's the only way XML mode is currently
triggered. Since that processing instruction is optional (as opposed to
namespace declarations which are mandatory), I wouldn't want to force it
on template authors.

I would think changing the headers like the above AND changing the
default mode to XML mode at the same time would probably be more
appropriate because it would only introduce one upgrade hurdle (the
mandatory namespace declarations).

Philipp


More information about the Zope3-dev mailing list