Please visit our sponsors !
DOM - The Document object
Take a look at the XML file used in the examples: note.xml
Examples
documentElement
How to return the node name of the root element.
createCDATASection
How to create a CDATA node and then append it to the nodeList.
createComment
How to create a comment node and then append it to the nodeList.
createElement
How to create an element and then append it to the nodeList.
createTextNode
How to create a text node then append the text node to the
nodeList.
getElementsByTagName
How to return the value of a specified node.
The Document object
The document object is the root element in the node tree. All nodes in the
node tree are childNodes of the document element. The document element is
required in all XML documents. The properties and methods of the
Document object are listed below:
W3C Properties
Property |
Description |
documentElement |
Returns the root element of the document |
doctype |
Returns the DTD or Schema for the document. |
implementation |
Returns the implementation object for this particular
document |
W3C Methods
Method |
Description |
createAttribute(attributeName) |
Creates an attribute node with the specified attribute name |
createCDATASection(text) |
Creates a CDATASection, containing the specified text |
createComment(text) |
Creates a comment node, containing the specified text |
createDocumentFragment() |
Creates an empty documentFragment object |
createElement(tagName) |
Creates an element with the specified tagName |
createEntityReference(referenceName) |
Creates an entityReference with the specified referenceName |
createProcessingInstruction(target,text) |
Creates a processingInstruction node, containing the
specified target and text |
createTextNode(text) |
Creates a text node, containing the specified text |
getElementsByTagName(tagName) |
Returns the specified node, and all its child nodes, as a
nodeList |
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|