5 ms·
The worst thing is not the existence of namespaces, but that are are relatively often implemented incorrectly. As an example of things that sometimes break: *
by _y8kz 3y ago
The worst thing is not the existence of namespaces, but that are are relatively often implemented incorrectly.
As an example of things that sometimes break:
* namespace redefinition: you have xmlns:ns1 on a parent node and xmlns:ns1 with different value on a child node.
* same namespace on sibling nodes (happens often with streaming): multiple child nodes have a xmls:ns1 with some value. That is only valid for that node.
* some processors expect namespaces only on a specific node (I think it was MS Navision ~ decade ago that failed when declaration wasn't on a specific node, but on a child node)
- TheRealDunkirk 3y agoIndeed. There is an XML formatted file that is important to the engineers at my company. Sometimes they're namespaced; sometimes not, so just I remove the namespace if it's there. It wasn't like the people who defined the namespace gave us any usable format definition to work with anyway. The only thing worse than XML is an XML definition that's only half-implemented. raw = Nokogiri::XML(File.read(uploaded_file).gsub(/ xmlns="[^"]\*"/, "")) { |config| config.noblanks }
- jerf 3y agoI am yet to see a system that uses namespaces 100% correctly, especially larger systems. XMPP is closest but they still have the stream tag defined as carrying a namespace, but as being the "same" stream tag without specifying it to be so, last I recall. The annoying thing is namespaces are not that complicated. They're probably five times more complicated than they need to be because you're always dealing with some library or system's half-assed bizarre implementation of them instead of the rather simple spec.