ZPTs and XML (was Re: [ZOPE] Ampersands (&'s) in URLs)

Geir Bækholt Geir Bækholt <geirh@funcom.com>
Fri, 17 Jan 2003 08:53:22 +0100


on or about, Friday, January 17, 2003, we have reason to believe that Jamie=
 Heilman wrote
something along the lines of :

>  If you want to be able to validate your code before its
> rendered you should use ZPT, not only is it cleaner than DTML its also
> valid XML.

Not neccesarily.

There seems to be a common misconception that ZPTs are always valid XML.
This is in no way true, but it is indeed *possible* to write well formed
and even valid XML in ZPT but it is no way required.

The original draft for ZPT was based on using XHTML (which is proper
XML), but it seemed that the the WYSIWYG tools many use to produce HTML
was not ready for XHTML - so a lot of work was put into the parser to
make it forgiving enough to accept 'old style' HTML, which is neither
well formed nor valid, but works nonetheless...

Pick which style you like by setting the content-type of the page
template to "text/html" or "text/xml" - the latter will force Zope to
use the XML-parser instead of the 'forgiving' one...

:)

--=20
Geir B=E6kholt        geir@funcom.com
Web Application/HCI-designer
Product Operations
Funcom Oslo