Because of space constraints, this section looks at the properties and methods of selected interfaces only.
The Document interface represents an XML document. The Document interface has the following properties:
The methods of the Document interface can be used to create new parts of an XML document or to retrieve information about the document. The Document interface has the following methods:
createAttributeNS(namespaceURI, qualifiedName)— Returns an Attr object
createElementNS(namespaceURI, qualifiedName)— Returns an Element object
createEntityReference(name)— Returns an EntityReference object
createProcessingInstruction(target,data)— Returns a ProcessingInstruction object
getElementsByTagNameNS(namespaceURI, localName)— Returns a NodeList object
The DocumentType interface is the DOM representation of the DOCTYPE declaration.
The DocumentType interface has the following properties:
The Element interface represents an element in an XML document.
The Element interface has the tagName property, which is a read-only property of type String.
The Element interface has the following methods:
getAttributeNS(namespaceURI, localName)— Returns a value of type String
getAttributeNodeNS(namespaceURI, localName)— Returns a value of type Attr
getElementsByTagNameNS(namespaceURI,localName)— Returns a NodeList object
hasAttributeNS(namespaceURI, localName)— Returns a value of type Boolean
removeAttributeNS(namespaceURI, localName)— Returns no value
The Attr interface is the DOM representation of an attribute in an XML document.
The Attr interface has the following properties:
The Attr interface has no methods specific to it.
The CharacterData interface is intended to contain character data. The Comment and Text interfaces extend the CharacterData interface.
The CharacterData interface has the following properties:
The CharacterData interface has the following methods:
The Text interface has no properties specific to it.
The Text interface has the splitText(offset ) method, which returns a Text object.
In Chapter 17 you will create some examples using DOM properties and methods.