Philipp said:
Why isn't there a way in standard DOM to access all XML of a node? (Similar to what outerHTML and innerHTML can do on Firefox or Internet Explorer when accessing HTML.)
Or am I missing something?
Well outerXml, that is the serialization of the node itself can certainly be achieved with W3C DOM Level 3 Load and Save e.g. with Opera
7.60 Preview you can do
function getOuterXml (node) {
if (node.ownerDocument && node.ownerDocument.implementation && document.implementation.createLSSerializer && (serializer = node.ownerDocument.implementation.createLSSerializer)) { return serializer.writeToString(node); } }
getOuterXml(someNode)
I think Java 1.5 (also named Java 5.0) also implements DOM Level 3 Load and Save so there you are also able to serialize a node with standard
DOM ways:
http://java.sun.com/j2se/1.5.0/docs/api/index.html
And innerXml only requires you to serialize all child nodes and concatenate the results.