XML DOM documentElement property
Definition and Usage
documentElement property returns the root node of the document.
grammar
documentObject.documentElement
Examples
The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, showing the location of the XML document:
Examples
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.documentElement;
document.write("Nodename: " + x.nodeName + "
");
document.write("Nodevalue: " + x.nodeValue + "
");
document.write("Nodetype: " + x.nodeType);
x=xmlDoc.documentElement;
document.write("Nodename: " + x.nodeName + "
");
document.write("Nodevalue: " + x.nodeValue + "
");
document.write("Nodetype: " + x.nodeType);
Output:
Nodename: bookstore
Nodevalue: null
Nodetype: 1
Nodevalue: null
Nodetype: 1
try it"
Document Object