[Zope3-dev] Re: Encoding of the PageTemplateFile

Philipp von Weitershausen philipp at weitershausen.de
Wed Jul 13 06:13:44 EDT 2005


Dmitry Vasiliev wrote:
>> I wouldn't mind such a change, but I think it's a little too late for 
>> 3.1. The first beta of 3.1 is already out, that means a feature freeze.
> 
> Ok. But default 'ascii' encoding seems like a bug for me and I want to 
> change it to 'utf-8' before the release.

I disagree on it being a bug, but that's just one man's opinion. I don't 
feel too strongly about it.

>> In the long term, I would rather have this specified the way it should 
>> be with XML data: using an <?xml version="1.0" encoding="utf-8" ?> 
>> processing instructions.
>>
>> The reason this doesn't work right now (or, I should say, work the way 
>> you'd expect it) is because the PageTemplate machinery makes the (now 
>> unnecessary) distinction between HTML and XML. It uses two different 
>> parsers for those; that way it can support SGML-based HTML4. HTML mode 
>> is the default, XML mode gets triggered by an <?xml ?> processing 
>> instruction like the one above.
>>
>> Apart from enforcing XML syntax, XML mode also requires you to 
>> explicitly provide definitions for the TAL, METAL and i18n namespaces 
>> (I think this is a good thing because a) it's the standard and b) 
>> people from other technologies know standard and are tired of Zope 
>> constantly cooking its own soup). Also, macros from XML PageTemplates 
>> are incompatible with macros from HTML PageTemplates.
>>
>> So, to conclude, I would propose to rip out HTML mode of PageTemplates 
>> completely in the long term. Everyone nowadays uses XHTML, the 
>> drawbacks are (apart from the required namespace declarations) none 
>> and the benefits apart from the discussed encoding issue are a) less 
>> code to maintain and b) compliance with standards.
> 
> I don't agree. Now I want to use PageTemplates for i-mode HTML which is 
> like restricted HTML, not XHTML.

Ah, good, so you have a use case for old-style HTML (though I wonder 
whether i-mode devices couldn't eat XML-ified HTML). In any case, that 
doesn't mean we couldn't make the XML mode the default mode.

Philipp


More information about the Zope3-dev mailing list