Forum Moderators: open
I'm wondering what the best way people have found to parse returned XML is? Do you use a library, and if so, which? Or is there a straightforward way of creating and parse XML from the responseText that I'm just missing?
Thanks very much!
if ( typeof xh.responseXml === 'undefined' ) {
// for mozzila, should not be required, Content-Type text/xml
var parser = new DOMParser();
var doc = parser.parseFromString( xh.responseText, "text/xml" );
var XMLDoc = doc.documentElement;
}
else {
if ( ( xh.responseXml )
&& ( xh.responseXml.documentElement === null )
&& ( xh.responseStream) ) {
xh.responseXml.load( xh.responseStream );
}
var XMLDoc = xh.responseXml.documentElement;
}