1

I think this property is quite useful,

http://www.w3schools.com/Dom/prop_document_xml.asp

But as you can see, it's only available in IE.

Is there an equivalent of this property in other browsers?

Thanks in advance.

bobo
  • 8,439
  • 11
  • 57
  • 81
  • 1
    possible dupicate: http://stackoverflow.com/questions/43455/how-do-i-serialize-a-dom-to-xml-text-using-javascript-in-a-cross-browser-way – user123444555621 Feb 26 '11 at 09:33

1 Answers1

4

The xml property is non-standard. The equivalent in other browsers is XMLSerializer.

function serializeXmlNode(xmlNode) {
    if (typeof window.XMLSerializer != "undefined") {
        return (new window.XMLSerializer()).serializeToString(xmlNode);
    } else if (typeof xmlNode.xml != "undefined") {
        return xmlNode.xml;
    }
    return "";
}
Tim Down
  • 318,141
  • 75
  • 454
  • 536