I think the raising of TemplateSyntaxError here is correct -- this
does not appear to be valid XML.
http://www.w3.org/TR/xml/#sec-starttags reads:
"""
The Namespaces in XML Recommendation [XML Names] assigns a meaning to
names containing colon characters. Therefore, authors should not use
the colon in XML names except for namespace purposes, but XML
processors must accept the colon as a name character.
"""
and http://www.w3.org/TR/xml-names/#ns-qualnames reads:
"""
[7] QName ::= PrefixedName | UnprefixedName
[8] PrefixedName ::= Prefix ':' LocalPart
[9] UnprefixedName ::= LocalPart
[10] Prefix ::= NCName
[11] LocalPart ::= NCName
"""
and http://www.w3.org/TR/xml-names/#NT-NCName reads:
"""[4] NCName ::= Name - (Char* ':' Char*) /* An XML Name, minus
the ":" */"""
So attribute names may contain only one colon.
> Almost gave up but
> then I managed to get things working with a little pyattrs trick that
> I want to share it in case others run into the same problem:
I'm tempted to say that Genshi should reject attribute names
containing multiple colons but I'm certainly not going to change the
current behaviour any time soon (too much possibility of breaking
users' templates for minimal gain). Another (and more sanctioned way)
of inserting invalid XML is to use the Markup() class.
Schiavo
Simon