[Zope3-dev] Encoding of the PageTemplateFile

Andreas Reuleaux reuleaux at web.de
Wed Jul 13 16:06:11 EDT 2005


I have been reading the discussion "Encoding of the PageTemplateFile"
of Philipp, Dmitry and Fred - through the Web: till now I have only
been subscribed to zope3-users. I wanted to add to that discussion, so
I just joined this zope3-dev list but obviously can't do a list reply
yet.

Philipp has already posted my points that I had mailed him privately
and in a reply to that message Fred had asked for pointers explaining
my point that IE gets confused when it sees <?xml ?> processing
instructions (Freds message:).

  http://mail.zope.org/pipermail/zope3-dev/2005-July/014906.html

I had started the original discussion on zope3-users (utf-8/latin-1
content in page templates)
  
  http://mail.zope.org/pipermail/zope3-users/2005-June/000622.html

and had mentioned Jeffry Zeldmans book "Designing with Web Standards"
where I got my knowledge from
  
  http://www.zeldman.com/dwws/

but there many places on the internet where this problem is mentioned
(do a search for doctype-switching, quirks mode, xml-prolog etc.)

This is just one link that explains the problem, an article 
"Rendering Mode and Doctype Switching" from Holly Bergevin

  http://www.communitymx.com/content/article.cfm?cid=85FEE

I am citing from page 2 of this article:

  Caution!

  Internet Explorer has an unfortunate bug involving the xml
  declaration. If there is anything on the first line before the
  doctype, IE6 will switch into "quirks" mode. This means that using
  an xml declaration (<?xml version="1.0" encoding="UTF-8"?>) will
  cause the behavior. An HTML comment, even an empty one, will do the
  same.

And quirks mode means the buggy box model etc. - So if one takes the
effort to write a correct xhtml page and specifies the doctype to make
the browser aware of this (doctype-switching) all this will still be
useless in IE if one specifies an xml-declaration in the first line.

So it should at least be possible to suppress the xml declaration
in the output. simpleTAL page templates e. g. have this possibility
in their expand output routine

  http://www.owlfish.com/software/simpleTAL/
  > API Documentation > Simple TAL

expand has a parameter suppressXMLDeclaration.

Just my 2 cents.

-Andreas


  



More information about the Zope3-dev mailing list