views:

200

answers:

1

Is there an XML deserializer for javascript? Preferably in the form of a jQuery plugin.

+3  A: 

You can manipulate XML with Javascript just like the DOM.

To do it with jQuery, you can just pass your XML to the jQuery function and voila, it is ready...

var dat = '<xml><test foo="bar">Cool!</test></xml>';
var xml = $(dat);
alert(xml.find("test").text());  // shows "Cool!"
alert(xml.find("test").attr("foo"));  // shows "bar"
Josh Stodola