views:

1208

answers:

4

I am looking for a good JavaScript library for parsing XML data. It should be much easier to use than the built-in XML DOM parsers bundled with the browsers.

I got spoiled a bit working with JSON and looking forward to something on similar lines for XML.

+5  A: 

I use jQuery for this. Here is a good example:

http://blog.reindel.com/2007/09/24/jquery-and-xml-revisited/

There are also lots and lots of good examples in the jQuery documentation:

http://www.webmonkey.com/tutorial/Easy_XML_Consumption_using_jQuery?oldid=20032

shadit
+1  A: 

Have you tried XML for SCRIPT. I have to admit, that I have never used it personally, but I have heard/read a few good things about it.

Give it a try and maybe share your experience here?

Mo
+1  A: 

If your XML is in a simple format you may look at jQuery and the XML to JSON plugin or the xmlObjectifier.

For a straight parser you may want to look at XML for <SCRIPT>.

palehorse
A: 

Why use a library? How difficult is it to use the built-in browser XML parsers? Answer: not hard. Create a function to parse the XML string into a document (using the w3schools example if you like) and you're done - you then have all the normal JavaScript DOM methods to use on your XML. Your function is a few lines. jQuery is 50K of unnecessary code.

Tim Down