Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Namespaces in XML was a bit of a bolt-on, and really showed the difference between the crowd who wanted to create XML to simplify defining new markup languages like HTML (the originators) and the XML as data crowd who wanted generalized tooling to support all XML data.

XPath really started to show the warts here - it leveraged namespaces as an axis, where your XPath could utilize namespaces which were defined at a particular element in the XSLT. However, this went against generalized tooling, as you had to understand which attributes or text were paths in order to know if namespaces had semantic value beyond the XML syntax itself.

IMHO, Canonical XML and XML Infosets were an effort to ret-con the new behavior back in - that namespaces and prefixes were not just used to serialize XML arbitrarily, but were semantically important parts of the XML itself. But at this point XML was too large to evolve - even XML 1.1 had relatively little market uptake.

On top of that, you had issues with how e.g. Microsoft Internet Explorer had divergent behavior for XSLT from other browsers/the spec.



They really should have made namespaces just be {url} prefixes on element and attribute names.

<{http://my.example.com/ns/fruit}citrus> ... </{http://my.example.com/ns/fruit}citrus>

Sure, it's textual bloat, but XML was already verbose and already compressed well with gzip, and it's a lot simpler to process.

The problem with the xmlns:alias="url" rewriting thing was that 1) most things didn't bother implementing it in full, and ended up e.g. relying on the name of the chosen alias 2) it had a special case of changing the current default namespace, which caused even more bad implementations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: