How do you view the xml string in a dom in javascript in Firefox?

monkeydust

New member
In IE, it is just the domdocument.xml. How the heck do you do that in Firefox? :confused:

Anybody have a good website that goes over xml manipulation in javascript for Mozilla/Firefox? I've been an IE-only dev for too many years! :cry:

EDIT: Ok, I found a good site here. But, it talks about the xml property but doesn't have any Mozilla equivalent! :confused:
 
Last edited:
Ok, I figured out how to do it. Would have been nice if they just added the .xml property though. :rolleyes:

Code:
var xmlDocument = "<test><greeting>hi</greeting></test>";
var xdomDocument = new DOMParser().parseFromString(xmlDocument,"text/xml");
var s = new XMLSerializer();
var str = s.serializeToString(xdomDocument);
alert(str);
 
Back
Top