When Zope parses text/html elements, instead of XML (xhtml and the like) uses a different parser. That is, not an XML parser, but rather an HTML parser like the ones used by browser, more relaxed, which allows for unclosed tags and the liks.
BUT…
there’s always a but. In HTML, technically speaking, not all combinations of tags are allowed, even if browsers permit it. E.g., a span cannot contain a div. So, zope too complains about this fact. But how does it complain?
Page Template Diagnostics
Compilation failed
zope.tal.htmltalparser.NestingError: Open tags <html>, <body>, <div>, <div>
do not match close tag </span>, at line 105, column 5
Now, please, tell me, why the fuck you told me about not matching tags when the problem is that the document in not valid against given DTD?!?! So, I lost a whole afternoon after this wrong error message, before been enlightened by the documentation. For sure, I didn’t mind looking at it, since the error message did state quite clearly what the problem was.
One more notes about designing programs in the future. Tell a lots of things when an error come out but, above all, tell the REAL error, not some approximate, wrong information. This is much worse that a laconic error message.
Posted by mattia as html, xhtml, zpt at 10:47 AM CEST
No Comments »
You know that there will never exist a single language to control everything when you start writing stuff like this:
<body tal:attributes=”onload python:’javascript:fill_form(%d);;’ % p[’uid’]”>
I mean, four programming/markup languages in one row it’s quite the best I’ve succeeded in for something meaningful.
(for the curious, I’m talking about markup XHTML, markup/programming TAL, programming python and javascript, or better ECMAScript).
Posted by mattia as ecmascript, python, xhtml, zpt at 9:26 PM CEST
No Comments »
Oh, what a nice start for a techie blog. Insulting one of the most used blogging technologies, which has given us all that semantic stuff almost for free.
Ok, now, please, taking a nice XHTML template, and filling it with php which makes out more XHTML which perhaps doesn’t conform at all with your idea of what you want to put inside, splitting it in many files, is not doing stuff in a semantic way, with clear separations of concers.
ZPT are syntax separared from semantic. PHP is not. I want something more: we’re in 2007, it’s the time to change our way of thinking web designing.
But I’ll take more on this rambling another time. It’s a bit too late now.
Posted by mattia as php, wordpress, xhtml, zpt at 2:02 AM CEST
No Comments »