3

I have a handful of code that uses the DOM to parse and traverse some XML data. It works fine on Gecko and WebKit but, of course, IE absolutely chokes on it. Is there a library for an XML DOM that supports:

  • getAttributeNS

  • localName

  • namespaceURI

Support for IE7 is about as far back as I need to go.

0

2 Answers 2

1

You can use jQuery to safely and easily parse XML in Internet Explorer. This tutorial Easy XML Consumption using jQuery will give you a more in-depth information on how you can do it.

Sign up to request clarification or add additional context in comments.

4 Comments

Yes, but I need proper namespace support; as in it must support lookup of attributes/nodes with a namespace URI.
Right, you can do so by using .find("[nodeName=foo:bar]")
You don't seem to understand what I need -- I need to be able to find nodes with namespace URIs; i.e. if I had xmlns:foo="http://www.example.com/ns", I want to be able to find foo:bar with only http://www.example.com/ns available, and not to use the foo: prefix to find tags.
Consuming namespaced xml with jQuery is a pain. And "find nodeName" doesn't work in jQuery 1.7.
0

Not sure if you want to go this route, but this can be done with MSXML using their nonstandard way of doing things. MSXML 3.0 comes with IE 6 and later.

I haven't actually done this ;-) but this might be what you need:

IXMLDOMNamedNodeMap.getQualifiedItem looks like getAttributeNS

http://msdn.microsoft.com/en-us/library/ms757075.aspx

IXMLDOMNode has a namespaceURI property.

http://msdn.microsoft.com/en-us/library/ms763813.aspx

IXMLDOMNode.baseName looks like localName

http://msdn.microsoft.com/en-us/library/ms767570.aspx

2 Comments

I was hoping there would be some library to abstract the differences between different platforms... :(
You'll probably have to write your own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.