3 ms·
Namespaces are great as a concept: I can take your standard document and extend it without any chance of conflicting in the future if you later a property or el
by acdha 4y ago
Namespaces are great as a concept: I can take your standard document and extend it without any chance of conflicting in the future if you later a property or element of the same name. This is really important for interchange systems since you inevitably end up with cases where a standard format has almost but not all of the vocabulary you need.
Unfortunately, namespaces as implemented in most XML tools are terrible and that's 100% the fault of the implementers. The problem is basically this:
<foo xmlns:bar="http://example.org/foobarspec">
<bar:a href="baaz">hello world</bar>
<foo>
To a human reading that, you should be able to write a selector like /foo/bar:a or even /foo/a but as an XML parser sees the world bar is actually:
{http://example.org/foobarspec}a
That's an implementation detail but a shocking percentage of XML library developers did not implement a lookup mechanism to resolve it when given "bar:a".
I would maintain that paying a single developer to make libxml2 suck less would have done more to help XML adoption than everything done by any XML-related standards group combined after Y2K.