XML FOR DOMINO
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
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:
Creates a CDATASection node whose value is the specified string.
public CDATASection createCDATASection(java.lang.String data) throws DOMException
Creates a Comment node given the specified string.
public Comment createComment(java.lang.String data)
Creates an empty DocumentFragment object.
public DocumentFragment createDocumentFragment()
Return value:
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.
public Element createElement(java.lang.String tagName) throws DOMException
Creates an EntityReference object.
public EntityReference createEntityReference(java.lang.String name) throws DOMException
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
Creates a ProcessingInstruction node given the specified name and data strings.
public ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data) throws DOMException
data - The data for the node.
Creates a Text node given the specified string.
public Text createTextNode(java.lang.String data)
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
public DocumentType getDoctype()
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".
public Element getDocumentElement()
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.
public NodeList getElementsByTagName(java.lang.String tagname)
The DOMImplementation object that handles this document. A DOM application may use objects from multiple implementations.
public DOMImplementation getImplementation()