Templates XML conformance
Fournier Daniel <[email protected]> Wed, 05 May 2004 16:30:10 +0200
| Newsgroups | gmane.comp.cms.xaraya.ui |
|---|---|
| Organization | Xaraya News Server |
| Message-ID | <[email protected]> |
The use of XML for Xaraya templates is a nice idea: during the development stage, one can validate them with ordinary XML tools. Unfortunatly, Xaraya_Classic theme default.xt template is not XML conformant. For instance, it uses an XML entity (&xar-baseurl;) to reference the site base URL. However this entity is not defined within any ENTITY declaration. How is this entity defined? Is it just a pseudo entity replaced in the PHP processing of the template? Another XML conformance violation is the DOCTYPE declaration for HTML, which should come before document root element. Why not use a true DOCTYPE declaration for the template and modify it to have the right HTML DOCTYPE including the baseurl entity declaration when compiling the template. The template prolog could be: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE xar:blocklayout [ <!ENTITY xar-baseurl "$xar-baseurl"> ]> <?xar type="page" ?> .... after compilation: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [ <!ENTITY xar-baseurl "http://www.myxarsite.com/"> ]> .... Another problem is the multiplication of elements with identical id attributes. For instance: <td id="leftmenus">. ID attributes have to be unique in the document. Probably a class attribute instead of an id (is this id used somewhere in the document processing?) would suffice. Daniel Fournier