XML FOR DOMINO


Document
Extends Node. The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.

Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created.

Methods

createAttribute

createCDATASection

createComment

createDocumentFragment

createElement

createEntityReference

createProcessingInstruction

createTextNode

getDoctype

getDocumentElement

getElementsByTagName

getImplementation

createAttribute

Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttribute method.

Syntax:

public Attr createAttribute(java.lang.String name)
               throws DOMException

Parameters:


Return value:
Throws:

createCDATASection

Creates a CDATASection node whose value is the specified string.

Syntax:

public CDATASection createCDATASection(java.lang.String data)
                 throws DOMException

Parameters:


Return value:
Throws:

createComment

Creates a Comment node given the specified string.

Syntax:

public Comment createComment(java.lang.String data)

Parameters:


Return value:

createDocumentFragment

Creates an empty DocumentFragment object.

Syntax:

public DocumentFragment createDocumentFragment()

Return value:


createElement

Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.

Syntax:

public Element createElement(java.lang.String tagName)
              throws DOMException

Parameters:


Return value:
Throws:

createEntityReference

Creates an EntityReference object.

Syntax:

public EntityReference createEntityReference(java.lang.String name)
                 throws DOMException

Parameters:


Return value:
Throws:

createProcessingInstruction

Creates a ProcessingInstruction node given the specified name and data strings.

Syntax:

public ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
        throws DOMException

Parameters:


Return value:
Throws:

createTextNode

Creates a Text node given the specified string.

Syntax:

public Text createTextNode(java.lang.String data)

Parameters:


Return value:

getDoctype

The Document Type Declaration associated with this document. For HTML documents as well as XML documents without a document type declaration this returns null. The DOM Level 1 does not support editing the Document Type Declaration, therefore docType cannot be altered in any way

Syntax:

public DocumentType getDoctype()

getDocumentElement

This is a convenience attribute that allows direct access to the child node that is the root element of the document. For HTML documents, this is the element with the tagName "HTML".

Syntax:

public Element getDocumentElement()

getElementsByTagName

Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered during a preorder traversal of the Document tree.

Syntax:

public NodeList getElementsByTagName(java.lang.String tagname)

Parameters:


Return value:

getImplementation

The DOMImplementation object that handles this document. A DOM application may use objects from multiple implementations.

Syntax:

public DOMImplementation getImplementation()