Newbie namespace question
Hi all, My question is really about HTML. I am implementing an open source defect tracking system called Roundup (a set of Python modules), and noticed that it uses TAL. However, I looked all through the Roundup and Python HTML and did not find a namespace declaration. Isn't one required? This from (http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.s tx): The prefix identifies the language, and must be introduced by an XML namespace declaration in XML and XHTML documents, like this: xmlns:ns="http://language.creator.com/namespaces/MyAttributeLanguage I realize that the statement above mentions XHTML but not HTML, implying that non-well-formed HTML does not require the declaration. But in the absence of the declaration, how does HTML know how to handle a TAL statement attribute? Why wouldn't it balk as soon as it sees the tal: prefix? Thanks, Jeffrey Blaze
Jeffrey Blaze wrote:
Hi all,
My question is really about HTML. I am implementing an open source defect tracking system called Roundup (a set of Python modules), and noticed that it uses TAL. However, I looked all through the Roundup and Python HTML and did not find a namespace declaration. Isn’t one required? This from (http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx):
The prefix identifies the language, and must be introduced by an XML namespace declaration in XML and XHTML documents, like this:
xmlns:ns="http://language.creator.com/namespaces/MyAttributeLanguage
I realize that the statement above mentions XHTML but not HTML, implying that non-well-formed HTML does not require the declaration. But in the absence of the declaration, how does HTML know how to handle a TAL statement attribute? Why wouldn’t it balk as soon as it sees the tal: prefix?
The TAL parser apparently isn't picky about having TAL namespaces defined in HTML. From that same page: Zope does not require an XML namespace declaration when creating templates with a content-type of text/html. However, it does require an XML namespace declaration for all other content-types. I would gather that it happily assumes that, in HTML (which doesn't parse nicely anyway), anything starting with 'tal:' or 'metal:' is a TAL or METAL attribute. And since they are all parsed and removed by the time the page is rendered it doesn't matter to the consumer of the page, either. --jcc
On Thu, 30 Sep 2004 13:41:26 -0700 "Jeffrey Blaze" <jeffrey.blaze@nomissolutions.com> wrote:
Why wouldn't it balk as soon as it sees the tal: prefix?
Because the TAL portions are handled server-side. That is, the server processes the XHTML with the embedded TAL attributes. As it performs the actions embodied in the tal: tags, the tags are removed. So the client simply never sees them at all. It is crucial when handling web technologies, in general, and zope-based technologies in particular to keep track of where something is happening. TAL is designed to happen exclusively on the server side, and to deliver well-formed XHTML (or XML) to the client.
Thanks,
Jeffrey Blaze
participants (3)
-
J. Cameron Cooper -
Jeffrey Blaze -
Jim Penny