java.lang.Object | ||||||
↳ | org.apache.xerces.dom.NodeImpl | |||||
↳ | org.apache.xerces.dom.ChildNode | |||||
↳ | org.apache.xerces.dom.ParentNode | |||||
↳ | org.apache.xerces.dom.CoreDocumentImpl | |||||
↳ | org.apache.xerces.dom.DocumentImpl | |||||
↳ | org.apache.html.dom.HTMLDocumentImpl |
Implements an HTML document. Provides access to the top level element in the document, its body and title.
Several methods create new nodes of all basic types (comment, text, element,
etc.). These methods create new nodes but do not place them in the document
tree. The nodes may be placed in the document tree using appendChild(Node)
or insertBefore(Node, Node)
, or
they may be placed in some other document tree.
Note: <FRAMESET> documents are not supported at the moment, neither
are direct document writing (open()
, write(String)
) and HTTP attribute
methods (getURL()
, getCookie()
).@xerces.internal
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.dom.NodeImpl
| |||||||||||
From interface
org.w3c.dom.Node
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.dom.DocumentImpl
| |||||||||||
From class
org.apache.xerces.dom.CoreDocumentImpl
| |||||||||||
From class
org.apache.xerces.dom.ParentNode
| |||||||||||
From class
org.apache.xerces.dom.ChildNode
| |||||||||||
From class
org.apache.xerces.dom.NodeImpl
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deep-clone a document, including fixing ownerDoc for the cloned
children.
| |||||||||||
Creates an Attribute having this Document as its OwnerDoc.
| |||||||||||
Factory method; creates an Element having this Document
as its OwnerDoc.
| |||||||||||
Introduced in DOM Level 2.
| |||||||||||
Xerces-specific constructor.
| |||||||||||
Convenience method, allowing direct access to the child node
which is considered the root of the actual document content.
| |||||||||||
Introduced in DOM Level 2
Returns the Element whose ID is given by elementId.
| |||||||||||
Return a live collection of all descendent Elements (not just
immediate children) having the specified tag name.
| |||||||||||
Introduced in DOM Level 2.
| |||||||||||
Obtains the <HEAD> element in the document, creating one if does
not exist before.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.dom.DocumentImpl
| |||||||||||
From class
org.apache.xerces.dom.CoreDocumentImpl
| |||||||||||
From class
org.apache.xerces.dom.ParentNode
| |||||||||||
From class
org.apache.xerces.dom.ChildNode
| |||||||||||
From class
org.apache.xerces.dom.NodeImpl
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.w3c.dom.Document
| |||||||||||
From interface
org.w3c.dom.Node
| |||||||||||
From interface
org.w3c.dom.NodeList
| |||||||||||
From interface
org.w3c.dom.events.DocumentEvent
| |||||||||||
From interface
org.w3c.dom.events.EventTarget
| |||||||||||
From interface
org.w3c.dom.html.HTMLDocument
| |||||||||||
From interface
org.w3c.dom.ranges.DocumentRange
| |||||||||||
From interface
org.w3c.dom.traversal.DocumentTraversal
|
Deep-clone a document, including fixing ownerDoc for the cloned children. Note that this requires bypassing the WRONG_DOCUMENT_ERR protection. I've chosen to implement it by calling importNode which is DOM Level 2.
deep | boolean, iff true replicate children |
---|
Creates an Attribute having this Document as its OwnerDoc.
Overrides createAttribute(String)
and returns
and attribute whose name is lower case.
name | The name of the attribute |
---|
if the attribute name is not acceptable | |
DOMException |
Factory method; creates an Element having this Document as its OwnerDoc.
tagName | The name of the element type to instantiate. For XML, this is case-sensitive. For HTML, the tagName parameter may be provided in any case, but it must be mapped to the canonical uppercase form by the DOM implementation. |
---|
DOMException |
---|
Introduced in DOM Level 2.
Creates an element of the given qualified name and namespace URI. If the given namespaceURI is null or an empty string and the qualifiedName has a prefix that is "xml", the created element is bound to the predefined namespace "http://www.w3.org/XML/1998/namespace" [Namespaces].
namespaceURI | The namespace URI of the element to create. |
---|---|
qualifiedName | The qualified name of the element type to instantiate. |
Xerces-specific constructor. "localName" is passed in, so we don't need to create a new String for it.
namespaceURI | The namespace URI of the element to create. |
---|---|
qualifiedName | The qualified name of the element type to instantiate. |
localpart | The local name of the element to instantiate. |
DOMException | INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character. |
---|
Convenience method, allowing direct access to the child node which is considered the root of the actual document content. For HTML, where it is legal to have more than one Element at the top level of the document, we pick the one with the tagName "HTML". For XML there should be only one top-level (HTML not yet supported.)
Introduced in DOM Level 2 Returns the Element whose ID is given by elementId. If no such element exists, returns null. Behavior is not defined if more than one element has this ID.
Note: The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return null.
Return a live collection of all descendent Elements (not just immediate children) having the specified tag name.
tagName | The type of Element we want to gather. "*" will be taken as a wildcard, meaning "all elements in the document." |
---|
Introduced in DOM Level 2.
Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they would be encountered in a preorder traversal of the Document tree.
namespaceURI | The namespace URI of the elements to match on. The special value "*" matches all namespaces. When it is null or an empty string, this method behaves like getElementsByTagName. |
---|---|
localName | The local name of the elements to match on. The special value "*" matches all local names. |
Obtains the <HEAD> element in the document, creating one if does
not exist before. The <HEAD> element is the first element in the
<HTML> in the document. The <HTML> element is obtained by
calling getDocumentElement()
. If the element does not exist, one
is created.
Called by getTitle()
, setTitle(String)
, getBody()
and
setBody(HTMLElement)
to assure the document has the <HEAD> element
correctly placed.