Consensus seems to be that QNames in XML content are problematic, even evil, and should definitely maybe be avoided (unless you're already using them). But they do provide a very neat form of abbreviation, one which can be used to pass on information in HTML without it being displayed in the browser. This is dead good for things like RDF in HTML. Meanwhile, there's a fundamental problem. Consider:
<dog xmlns="http://purl.org/stuff/dogs/" xmlns:cls="http://purl.org/stuff/colors/"> <paw color="cls:golden" /> </dog>
The intention is for
cls:golden to be interpreted as
http://purl.org/stuff/colors/golden. But once
passed through an XML processor or two the document may look like
<dog xmlns="http://purl.org/stuff/dogs/> <paw color="cls:golden" /> </dog>
cls:golden now? Bottom line is QNames have no special
meaning inside content within a standard XML+namespaces
interpretation. They simply don't work.
But rather than throwing the baby out with the bathwater, might it not be more desirable to make them work? What's the 'X' in XML for? Why don't we simply define an additional mechanism on top of XML+namespaces that will look after the prefix resolution, e.g.
<dog xmlns="http://purl.org/stuff/dogs/ xmlns:nicer="http://purl.org/stuff/nicer/"> <nicer:map nicer:prefix="cls" nicer:namespace="http://purl.org/stuff/colors/"/> <paw color="cls:golden" /> </dog>
The content of the attribute
looks like a QName, but strictly speaking isn't. Sure, the
resolution won't just happen with regular XML tools, but who cares?
nicer:map element used to carry the prefix mapping
will be preserved through all kinds of processing. Software that
has a use for the information comes across it (e.g. html2rdf) con
Ok, I'm sure something like this has been suggested before - it's only really a variation on the DC.Description style of RFC 2731. But why aren't people using it? It can fix the information loss problem, and just as significantly defuses the anti-QNames arguments that seem to be scuppering lots of otherwise perfectly good ideas. It doesn't really matter if a mechanism like this were defined anew on a per-spec basis, but it would be better if a single syntax was used across the board.[Danny]