XML To HTML Snippet
This John Resig post about nodeName demonstrates once again how trustfulness are edge cases in JavaScript. I must agree 100% with @jdalton : frameworks or selector libraries should not be concerned about these cases. First of all there is no universal solution so whatever effort able to slow down libraries won't be perfect, then why bother? Secondly, I cannot even understand why on earth somebody could need to adopt XML nodes in that way. Agreed that importNode or adoptNode should not be that buggy, but at the same time I have always used XSL(T) to inject XML into HTML and I have never had problems. Different Worlds In an XML document a tag is just a tag. It does not matter which name we chose or which JavaScript event we attached, XML is simply a data protocol, or transporter, and nothing else. A link, a div, an head, the html node itself, does not mean anything different in XML so again: why do we need to import in that way? In Internet Explorer we have the xml property which i...