Example of tree structure of the XML DOM

<?xml version="1.0"?> <!DOCTYPE earth SYSTEM "earthArea.dtd"> <earth totalArea="100"> &...

Example attributes in Node interface

<book>       <title>Lamp is Lit</title>       <author>Ruskin Bond</author>...

Example with general node interface methods in XML

The XML file and Javascript file to load the XML. myData.xml <?xml version='1.0'?> <root>

Example of length method

xmldoc = loadXMLDoc(“myData.xml”);    x = xmldoc.getElementsByTagName(“book”);    document.write(x.item(0).att...

Example of getElementsByTagNameNS() method

<!DOCTYPE html> <html>    <body>       <h1>document interface </h1>&nb...

Example of how to add a new element node to an XML file

myData.xml <?xml version='1.0'?> <root>     <data>   &nb...

Example of how to add attribute's name and value to XML

The example adds attribute name and value to the <data> element of the xml document. It also displays the name and textContent attributes....

Example how to add a CDATASection to the XML DOM

myData.xml <?xml version='1.0'?> <root>     <data>   &nb...

Example how to delete a text element and add a new one to a XML

myData.xml <?xml version='1.0'?> <root>     <data>   &nb...

Example with createElement() method

element.xml <?xml version="1.0"?> <students>       <name>Roshni</name&...