Re: Showstopper issue with new Attribute text
Norman Walsh <[email protected]> Wed, 17 Mar 2004 13:34:12 -0500
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <[email protected]> |
/ Elliotte Rusty Harold <[email protected]> was heard to say: [...] | The local name property of the attribute information item for an xmlns | attribute is xmlns. The prefix property for the attribute information | corresponding to an xmlns attribute has no value. Therefore, when SAX | reports these I maintain that the local name should be xmlns, not the | empty string. The qualified name should also be xmlns. This is still a | showstopper issue, even allowing xmlns attributes into the | http://www.w3.org/2000/xmlns/ namespace. AFAICT, we're in this bind because xmlns things aren't attributes. By default, these things don't get reported as attributes, so we're ok. If someone has enabled the namespace-prefixes feature, they're asking for them to be reported as attributes and we have a problem. For declarations of namespaces other than the default namespace, it's fairly straightforward: xmlns:foo ==> prefix "xmlns", local name "foo", namespace nane "http://www.w3.org/2000/xmlns/" The question, then, is what to do with default namespace declarations. The current answer: xmlns ==> prefix "xmlns", local name "", namespace nane "http://www.w3.org/2000/xmlns/" is incoherent if you look at it as a regular attribute (you can't have a name with an empty local name part) but very symmetrical if you look at it as a magic quasi-attribute namespace declaration: it's a declaration for the empty prefix and in namespace declarations, the prefix gets reported in the local name. An alternate answer: xmlns ==> prefix "", local name "xmlns", namespace nane "http://www.w3.org/2000/xmlns/" is coherent as an attribute, but incoherent from a namespace perspective: attribute names without colons are never in a namespace. Another alternative: xmlns ==> prefix "xmlns", local name "xmlns", namespace nane "http://www.w3.org/2000/xmlns/" is coherent as both an attribute and a namespace, but it's a declaration for the "xmlns" prefix, not the default namespace. There's no "right" answer here because namespace declarations aren't attributes. I think if you insist on looking at them as attributes, the best solution is to deal with the possible special case that the local name may be "". Be seeing you, norm -- Norman Walsh <[email protected]> | Part of thinking is its cruelty, aside http://nwalsh.com/ | from its contents. It is the process of | detachment from everything else, the | ripping, the wrenching, the sharpness | of cutting.--Elias Canetti
signature.asc
(application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBAWJomOyltUcwYWjsRAoiLAJ94aYDGIXCb9Xi9BF3G5LKyZKd6MQCgibyj XgigoWxlSn1G0pxjHFvRK1k= =AbPa -----END PGP SIGNATURE-----