Class DTMNodeProxy
- All Implemented Interfaces:
Attr
,CharacterData
,Comment
,Document
,DocumentFragment
,Element
,Node
,ProcessingInstruction
,Text
DTMNodeProxy
presents a DOM Node API front-end to the DTM model.
It does _not_ attempt to address the "node identity" question; no effort is made to prevent the creation of multiple proxies referring to a single DTM node. Users can create a mechanism for managing this, or relinquish the use of "==" and use the .sameNodeAs() mechanism, which is under consideration for future versions of the DOM.
DTMNodeProxy may be subclassed further to present specific DOM node types.
- See Also:
-
Field Summary
FieldsFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Constructor Summary
ConstructorsConstructorDescriptionDTMNodeProxy
(DTM dtm, int node) Create a DTMNodeProxy Node representing a specific Node in a DTM -
Method Summary
Modifier and TypeMethodDescriptionNEEDSDOC Method adoptNode NEEDSDOC @param sourcefinal Node
appendChild
(Node newChild) final void
appendData
(String arg) final Node
cloneNode
(boolean deep) short
compareDocumentPosition
(Node other) Compares a node with this node with regard to their position in the document.final Attr
createAttribute
(String name) final Attr
createAttributeNS
(String namespaceURI, String qualifiedName) final CDATASection
createCDATASection
(String data) final Comment
createComment
(String data) final DocumentFragment
final Element
createElement
(String tagName) final Element
createElementNS
(String namespaceURI, String qualifiedName) final EntityReference
createEntityReference
(String name) final ProcessingInstruction
createProcessingInstruction
(String target, String data) final Text
createTextNode
(String data) final void
deleteData
(int offset, int count) final boolean
Test for equality based on node number.final boolean
Test for equality based on node number.DOM Level 3 An attribute specifying the actual encoding of this document.final String
getAttribute
(String name) final Attr
getAttributeNode
(String name) final Attr
getAttributeNodeNS
(String namespaceURI, String localName) final String
getAttributeNS
(String namespaceURI, String localName) final NamedNodeMap
The absolute base URI of this node ornull
if undefined.final NodeList
final String
getData()
final DocumentType
final Element
This is a bit of a problem in DTM, since a DTM may be a Document Fragment and hence not have a clear-cut Document Element.DOM Level 3 The location of the document ornull
if undefined.The configuration used whenDocument.normalizeDocument
is invoked.final DTM
getDTM()
NON-DOM: Return the DTM modelfinal int
NON-DOM: Return the DTM node numberfinal Element
getElementById
(String elementId) final NodeList
getElementsByTagName
(String tagname) final NodeList
getElementsByTagNameNS
(String namespaceURI, String localName) getFeature
(String feature, String version) This method returns a specialized object which implements the specialized APIs of the specified feature and version.final Node
final DOMImplementation
final Node
final int
final String
final String
getName()
final String
final Node
final String
final short
final String
final Document
final Element
Get the owner element of an attribute.final Node
final Node
final String
final Node
final boolean
boolean
final String
final String
final String
A PI's "target" states what processor channel the PI's data should be directed to.This attribute returns the text content of this node and its descendants.getUserData
(String key) Retrieves the object associated to a key on a this node.final String
getValue()
DOM Level 3 Returns all text ofText
nodes logically-adjacent text nodes to this node, concatenated in document order.boolean
boolean
hasAttribute
(String name) Method hasAttributeboolean
hasAttributeNS
(String namespaceURI, String localName) Method hasAttributeNSboolean
Introduced in DOM Level 2.final boolean
final Node
importNode
(Node importedNode, boolean deep) final Node
insertBefore
(Node newChild, Node refChild) final void
insertData
(int offset, String arg) boolean
isDefaultNamespace
(String namespaceURI) DOM Level 3: This method checks if the specifiednamespaceURI
is the default namespace or not.boolean
DOM Level 3 Returns whether this text node contains whitespace in element content, often abusively called "ignorable whitespace".boolean
isEqualNode
(Node arg) Tests whether two nodes are equal.boolean
isId()
boolean
isSameNode
(Node other) Returns whether this node is the same node as the given one.final boolean
isSupported
(String feature, String version) Ask whether we support a given DOM feature.lookupNamespaceURI
(String specifiedPrefix) DOM Level 3: Look up the namespace URI associated to the given prefix, starting from this node.lookupPrefix
(String namespaceURI) DOM Level 3: Look up the prefix associated to the given namespace URI, starting from this node.final void
void
DOM Level 3 Normalize document.final void
removeAttribute
(String name) final Attr
removeAttributeNode
(Attr oldAttr) final void
removeAttributeNS
(String namespaceURI, String localName) final Node
removeChild
(Node oldChild) renameNode
(Node n, String namespaceURI, String name) DOM Level 3 Renaming nodefinal Node
replaceChild
(Node newChild, Node oldChild) final void
replaceData
(int offset, int count, String arg) replaceWholeText
(String content) DOM Level 3final boolean
sameNodeAs
(Node other) FUTURE DOM: Test node identity, in lieu of Node==Nodevoid
setActualEncoding
(String value) DOM Level 3 An attribute specifying the actual encoding of this document.final void
setAttribute
(String name, String value) final Attr
setAttributeNode
(Attr newAttr) final Attr
setAttributeNodeNS
(Attr newAttr) final void
setAttributeNS
(String namespaceURI, String qualifiedName, String value) final void
void
setDocumentURI
(String documentURI) DOM Level 3void
setIdAttribute
(boolean id) NON-DOM: set the type of this attribute to be ID type.void
setIdAttribute
(String name, boolean makeId) DOM Level 3: register the given attribute node as an ID attributevoid
setIdAttributeNode
(Attr at, boolean makeId) DOM Level 3: register the given attribute node as an ID attributevoid
setIdAttributeNS
(String namespaceURI, String localName, boolean makeId) DOM Level 3: register the given attribute node as an ID attributefinal void
setNodeValue
(String nodeValue) final void
void
setStrictErrorChecking
(boolean strictErrorChecking) void
setTextContent
(String textContent) This attribute returns the text content of this node and its descendants.setUserData
(String key, Object data, UserDataHandler handler) final void
void
setXmlEncoding
(String xmlEncoding) void
setXmlStandalone
(boolean xmlStandalone) void
setXmlVersion
(String xmlVersion) final Text
splitText
(int offset) final String
substringData
(int offset, int count) final boolean
Ask whether we support a given DOM feature.
-
Field Details
-
dtm
The DTM for this node.
-
-
Constructor Details
-
DTMNodeProxy
Create a DTMNodeProxy Node representing a specific Node in a DTM- Parameters:
dtm
- The DTM Reference, must be non-null.node
- The DTM node handle.
-
-
Method Details
-
getDTM
NON-DOM: Return the DTM model- Returns:
- The DTM that this proxy is a representative for.
-
getDTMNodeNumber
public final int getDTMNodeNumber()NON-DOM: Return the DTM node number- Returns:
- The DTM node handle.
-
equals
Test for equality based on node number.- Parameters:
node
- A DTM node proxy reference.- Returns:
- true if the given node has the same handle as this node.
-
equals
Test for equality based on node number. -
sameNodeAs
FUTURE DOM: Test node identity, in lieu of Node==Node- Parameters:
other
-- Returns:
- true if the given node has the same handle as this node.
-
getNodeName
- Specified by:
getNodeName
in interfaceNode
- See Also:
-
getTarget
A PI's "target" states what processor channel the PI's data should be directed to. It is defined differently in HTML and XML.In XML, a PI's "target" is the first (whitespace-delimited) token following the "invalid input: '<'?" token that begins the PI.
In HTML, target is always null.
Note that getNodeName is aliased to getTarget.
- Specified by:
getTarget
in interfaceProcessingInstruction
-
getLocalName
- Specified by:
getLocalName
in interfaceNode
- See Also:
-
getPrefix
-
setPrefix
- Specified by:
setPrefix
in interfaceNode
- Parameters:
prefix
-- Throws:
DOMException
- See Also:
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNode
- See Also:
-
supports
Ask whether we support a given DOM feature. In fact, we do not _fully_ support any DOM feature -- we're a read-only subset -- so arguably we should always return false. Or we could say that we support DOM Core Level 2 but all nodes are read-only. Unclear which answer is least misleading. NON-DOM method. This was present in early drafts of DOM Level 2, but was renamed isSupported. It's present here only because it's cheap, harmless, and might help some poor fool who is still trying to use an early Working Draft of the DOM.- Parameters:
feature
-version
-- Returns:
- false
-
isSupported
Ask whether we support a given DOM feature. In fact, we do not _fully_ support any DOM feature -- we're a read-only subset -- so arguably we should always return false.- Specified by:
isSupported
in interfaceNode
- Parameters:
feature
-version
-- Returns:
- false
- See Also:
-
getNodeValue
- Specified by:
getNodeValue
in interfaceNode
- Throws:
DOMException
- See Also:
-
getStringValue
- Returns:
- The string value of the node
- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValue
in interfaceNode
- Parameters:
nodeValue
-- Throws:
DOMException
- See Also:
-
getNodeType
public final short getNodeType()- Specified by:
getNodeType
in interfaceNode
- See Also:
-
getParentNode
- Specified by:
getParentNode
in interfaceNode
- See Also:
-
getOwnerNode
- See Also:
-
getChildNodes
- Specified by:
getChildNodes
in interfaceNode
- See Also:
-
getFirstChild
- Specified by:
getFirstChild
in interfaceNode
- See Also:
-
getLastChild
- Specified by:
getLastChild
in interfaceNode
- See Also:
-
getPreviousSibling
- Specified by:
getPreviousSibling
in interfaceNode
- See Also:
-
getNextSibling
- Specified by:
getNextSibling
in interfaceNode
- See Also:
-
getAttributes
- Specified by:
getAttributes
in interfaceNode
- See Also:
-
hasAttribute
Method hasAttribute- Specified by:
hasAttribute
in interfaceElement
- Parameters:
name
-
-
hasAttributeNS
Method hasAttributeNS- Specified by:
hasAttributeNS
in interfaceElement
- Parameters:
namespaceURI
-localName
-
-
getOwnerDocument
- Specified by:
getOwnerDocument
in interfaceNode
- See Also:
-
insertBefore
- Specified by:
insertBefore
in interfaceNode
- Parameters:
newChild
-refChild
-- Throws:
DOMException
- See Also:
-
replaceChild
- Specified by:
replaceChild
in interfaceNode
- Parameters:
newChild
-oldChild
-- Throws:
DOMException
- See Also:
-
removeChild
- Specified by:
removeChild
in interfaceNode
- Parameters:
oldChild
-- Throws:
DOMException
- See Also:
-
appendChild
- Specified by:
appendChild
in interfaceNode
- Parameters:
newChild
-- Throws:
DOMException
- See Also:
-
hasChildNodes
public final boolean hasChildNodes()- Specified by:
hasChildNodes
in interfaceNode
- See Also:
-
cloneNode
-
getDoctype
- Specified by:
getDoctype
in interfaceDocument
- See Also:
-
getImplementation
- Specified by:
getImplementation
in interfaceDocument
- See Also:
-
getDocumentElement
This is a bit of a problem in DTM, since a DTM may be a Document Fragment and hence not have a clear-cut Document Element. We can make it work in the well-formed cases but would that be confusing for others?- Specified by:
getDocumentElement
in interfaceDocument
- See Also:
-
createElement
- Specified by:
createElement
in interfaceDocument
- Parameters:
tagName
-- Throws:
DOMException
- See Also:
-
createDocumentFragment
- Specified by:
createDocumentFragment
in interfaceDocument
- See Also:
-
createTextNode
- Specified by:
createTextNode
in interfaceDocument
- Parameters:
data
-- See Also:
-
createComment
- Specified by:
createComment
in interfaceDocument
- Parameters:
data
-- See Also:
-
createCDATASection
- Specified by:
createCDATASection
in interfaceDocument
- Parameters:
data
-- Throws:
DOMException
- See Also:
-
createProcessingInstruction
public final ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException - Specified by:
createProcessingInstruction
in interfaceDocument
- Parameters:
target
-data
-- Throws:
DOMException
- See Also:
-
createAttribute
- Specified by:
createAttribute
in interfaceDocument
- Parameters:
name
-- Throws:
DOMException
- See Also:
-
createEntityReference
- Specified by:
createEntityReference
in interfaceDocument
- Parameters:
name
-- Throws:
DOMException
- See Also:
-
getElementsByTagName
- Specified by:
getElementsByTagName
in interfaceDocument
- Specified by:
getElementsByTagName
in interfaceElement
- Parameters:
tagname
-- See Also:
-
importNode
- Specified by:
importNode
in interfaceDocument
- Parameters:
importedNode
-deep
-- Throws:
DOMException
- See Also:
-
createElementNS
- Specified by:
createElementNS
in interfaceDocument
- Parameters:
namespaceURI
-qualifiedName
-- Throws:
DOMException
- See Also:
-
createAttributeNS
- Specified by:
createAttributeNS
in interfaceDocument
- Parameters:
namespaceURI
-qualifiedName
-- Throws:
DOMException
- See Also:
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNS
in interfaceDocument
- Specified by:
getElementsByTagNameNS
in interfaceElement
- Parameters:
namespaceURI
-localName
-- See Also:
-
getElementById
- Specified by:
getElementById
in interfaceDocument
- Parameters:
elementId
-- See Also:
-
splitText
- Specified by:
splitText
in interfaceText
- Parameters:
offset
-- Throws:
DOMException
- See Also:
-
getData
- Specified by:
getData
in interfaceCharacterData
- Specified by:
getData
in interfaceProcessingInstruction
- Throws:
DOMException
- See Also:
-
setData
- Specified by:
setData
in interfaceCharacterData
- Specified by:
setData
in interfaceProcessingInstruction
- Parameters:
data
-- Throws:
DOMException
- See Also:
-
getLength
public final int getLength()- Specified by:
getLength
in interfaceCharacterData
- See Also:
-
substringData
- Specified by:
substringData
in interfaceCharacterData
- Parameters:
offset
-count
-- Throws:
DOMException
- See Also:
-
appendData
- Specified by:
appendData
in interfaceCharacterData
- Parameters:
arg
-- Throws:
DOMException
- See Also:
-
insertData
- Specified by:
insertData
in interfaceCharacterData
- Parameters:
offset
-arg
-- Throws:
DOMException
- See Also:
-
deleteData
- Specified by:
deleteData
in interfaceCharacterData
- Parameters:
offset
-count
-- Throws:
DOMException
- See Also:
-
replaceData
- Specified by:
replaceData
in interfaceCharacterData
- Parameters:
offset
-count
-arg
-- Throws:
DOMException
- See Also:
-
getTagName
- Specified by:
getTagName
in interfaceElement
- See Also:
-
getAttribute
- Specified by:
getAttribute
in interfaceElement
- Parameters:
name
-- See Also:
-
setAttribute
- Specified by:
setAttribute
in interfaceElement
- Parameters:
name
-value
-- Throws:
DOMException
- See Also:
-
removeAttribute
- Specified by:
removeAttribute
in interfaceElement
- Parameters:
name
-- Throws:
DOMException
- See Also:
-
getAttributeNode
- Specified by:
getAttributeNode
in interfaceElement
- Parameters:
name
-- See Also:
-
setAttributeNode
- Specified by:
setAttributeNode
in interfaceElement
- Parameters:
newAttr
-- Throws:
DOMException
- See Also:
-
removeAttributeNode
- Specified by:
removeAttributeNode
in interfaceElement
- Parameters:
oldAttr
-- Throws:
DOMException
- See Also:
-
hasAttributes
public boolean hasAttributes()Introduced in DOM Level 2.- Specified by:
hasAttributes
in interfaceNode
-
normalize
public final void normalize() -
getAttributeNS
- Specified by:
getAttributeNS
in interfaceElement
- Parameters:
namespaceURI
-localName
-- See Also:
-
setAttributeNS
public final void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException - Specified by:
setAttributeNS
in interfaceElement
- Parameters:
namespaceURI
-qualifiedName
-value
-- Throws:
DOMException
- See Also:
-
removeAttributeNS
- Specified by:
removeAttributeNS
in interfaceElement
- Parameters:
namespaceURI
-localName
-- Throws:
DOMException
- See Also:
-
getAttributeNodeNS
- Specified by:
getAttributeNodeNS
in interfaceElement
- Parameters:
namespaceURI
-localName
-- See Also:
-
setAttributeNodeNS
- Specified by:
setAttributeNodeNS
in interfaceElement
- Parameters:
newAttr
-- Throws:
DOMException
- See Also:
-
getName
-
getSpecified
public final boolean getSpecified()- Specified by:
getSpecified
in interfaceAttr
- See Also:
-
getValue
-
setValue
-
getOwnerElement
Get the owner element of an attribute.- Specified by:
getOwnerElement
in interfaceAttr
- See Also:
-
adoptNode
NEEDSDOC Method adoptNode NEEDSDOC @param source- Specified by:
adoptNode
in interfaceDocument
- Throws:
DOMException
-
getInputEncoding
Based on the Document Object Model (DOM) Level 3 Core Specification of 07 April 2004..
An attribute specifying, as part of the XML declaration, the encoding of this document. This is
null
when unspecified.- Specified by:
getInputEncoding
in interfaceDocument
- Since:
- DOM Level 3
-
getStrictErrorChecking
public boolean getStrictErrorChecking()Based on the Document Object Model (DOM) Level 3 Core Specification of 07 April 2004..
An attribute specifying whether errors checking is enforced or not. When set to
false
, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMException
. In case of error, the behavior is undefined. This attribute istrue
by defaults.- Specified by:
getStrictErrorChecking
in interfaceDocument
- Since:
- DOM Level 3
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) Based on the Document Object Model (DOM) Level 3 Core Specification of 07 April 2004..
An attribute specifying whether errors checking is enforced or not. When set to
false
, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMException
. In case of error, the behavior is undefined. This attribute istrue
by defaults.- Specified by:
setStrictErrorChecking
in interfaceDocument
- Since:
- DOM Level 3 NEEDSDOC @param strictErrorChecking
-
setUserData
- Specified by:
setUserData
in interfaceNode
-
getUserData
Retrieves the object associated to a key on a this node. The object must first have been set to this node by callingsetUserData
with the same key.- Specified by:
getUserData
in interfaceNode
- Parameters:
key
- The key the object is associated to.- Returns:
- Returns the
DOMObject
associated to the given key on this node, ornull
if there was none. - Since:
- DOM Level 3
-
getFeature
This method returns a specialized object which implements the specialized APIs of the specified feature and version. The specialized object may also be obtained by using binding-specific casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations.- Specified by:
getFeature
in interfaceNode
- Parameters:
feature
- The name of the feature requested (case-insensitive).version
- This is the version number of the feature to test. If the version isnull
or the empty string, supporting any version of the feature will cause the method to return an object that supports at least one version of the feature.- Returns:
- Returns an object which implements the specialized APIs of
the specified feature and version, if any, or
null
if there is no object which implements interfaces associated with that feature. If theDOMObject
returned by this method implements theNode
interface, it must delegate to the primary coreNode
and not return results inconsistent with the primary coreNode
such as attributes, childNodes, etc. - Since:
- DOM Level 3
-
isEqualNode
Tests whether two nodes are equal.
This method tests for equality of nodes, not sameness (i.e., whether the two nodes are references to the same object) which can be tested withNode.isSameNode
. All nodes that are the same will also be equal, though the reverse may not be true.
Two nodes are equal if and only if the following conditions are satisfied: The two nodes are of the same type.The following string attributes are equal:nodeName
,localName
,namespaceURI
,prefix
,nodeValue
,baseURI
. This is: they are bothnull
, or they have the same length and are character for character identical. Theattributes
NamedNodeMaps
are equal. This is: they are bothnull
, or they have the same length and for each node that exists in one map there is a node that exists in the other map and is equal, although not necessarily at the same index.ThechildNodes
NodeLists
are equal. This is: they are bothnull
, or they have the same length and contain equal nodes at the same index. This is true forAttr
nodes as for any other type of node. Note that normalization can affect equality; to avoid this, nodes should be normalized before being compared.
For twoDocumentType
nodes to be equal, the following conditions must also be satisfied: The following string attributes are equal:publicId
,systemId
,internalSubset
.Theentities
NamedNodeMaps
are equal.Thenotations
NamedNodeMaps
are equal.
On the other hand, the following do not affect equality: theownerDocument
attribute, thespecified
attribute forAttr
nodes, theisWhitespaceInElementContent
attribute forText
nodes, as well as any user data or event listeners registered on the nodes.- Specified by:
isEqualNode
in interfaceNode
- Parameters:
arg
- The node to compare equality with.deep
- Iftrue
, recursively compare the subtrees; iffalse
, compare only the nodes themselves (and its attributes, if it is anElement
).- Returns:
- If the nodes, and possibly subtrees are equal,
true
otherwisefalse
. - Since:
- DOM Level 3
-
lookupNamespaceURI
DOM Level 3: Look up the namespace URI associated to the given prefix, starting from this node. Use lookupNamespaceURI(null) to lookup the default namespace- Specified by:
lookupNamespaceURI
in interfaceNode
- Parameters:
namespaceURI
-- Returns:
- th URI for the namespace
- Since:
- DOM Level 3
-
isDefaultNamespace
DOM Level 3: This method checks if the specifiednamespaceURI
is the default namespace or not.- Specified by:
isDefaultNamespace
in interfaceNode
- Parameters:
namespaceURI
- The namespace URI to look for.- Returns:
true
if the specifiednamespaceURI
is the default namespace,false
otherwise.- Since:
- DOM Level 3
-
lookupPrefix
DOM Level 3: Look up the prefix associated to the given namespace URI, starting from this node.- Specified by:
lookupPrefix
in interfaceNode
- Parameters:
namespaceURI
-- Returns:
- the prefix for the namespace
-
isSameNode
Returns whether this node is the same node as the given one.
This method provides a way to determine whether twoNode
references returned by the implementation reference the same object. When twoNode
references are references to the same object, even if through a proxy, the references may be used completely interchangably, such that all attributes have the same values and calling the same DOM method on either reference always has exactly the same effect.- Specified by:
isSameNode
in interfaceNode
- Parameters:
other
- The node to test against.- Returns:
- Returns
true
if the nodes are the same,false
otherwise. - Since:
- DOM Level 3
-
setTextContent
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. When set, any possible children this node may have are removed and replaced by a singleText
node containing the string this attribute is set to. On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed, the returned string does not contain the element content whitespaces . Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
The string returned is made of the text content of this node depending on its type, as defined below:Node type Content ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent
attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodesATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null - Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in aDOMString
variable on the implementation platform.- Since:
- DOM Level 3
-
getTextContent
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. When set, any possible children this node may have are removed and replaced by a singleText
node containing the string this attribute is set to. On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed, the returned string does not contain the element content whitespaces . Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
The string returned is made of the text content of this node depending on its type, as defined below:Node type Content ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent
attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodesATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null - Specified by:
getTextContent
in interfaceNode
- Throws:
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.DOMException
- DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in aDOMString
variable on the implementation platform.- Since:
- DOM Level 3
-
compareDocumentPosition
Compares a node with this node with regard to their position in the document.- Specified by:
compareDocumentPosition
in interfaceNode
- Parameters:
other
- The node to compare against this node.- Returns:
- Returns how the given node is positioned relatively to this node.
- Throws:
DOMException
- Since:
- DOM Level 3
-
getBaseURI
The absolute base URI of this node ornull
if undefined. This value is computed according to . However, when theDocument
supports the feature "HTML" , the base URI is computed using first the value of the href attribute of the HTML BASE element if any, and the value of thedocumentURI
attribute from theDocument
interface otherwise.
When the node is anElement
, aDocument
or a aProcessingInstruction
, this attribute represents the properties [base URI] defined in . When the node is aNotation
, anEntity
, or anEntityReference
, this attribute represents the properties [declaration base URI] in the . How will this be affected by resolution of relative namespace URIs issue?It's not.Should this only be on Document, Element, ProcessingInstruction, Entity, and Notation nodes, according to the infoset? If not, what is it equal to on other nodes? Null? An empty string? I think it should be the parent's.No.Should this be read-only and computed or and actual read-write attribute?Read-only and computed (F2F 19 Jun 2000 and teleconference 30 May 2001).If the base HTML element is not yet attached to a document, does the insert change the Document.baseURI? Yes. (F2F 26 Sep 2001)- Specified by:
getBaseURI
in interfaceNode
- Since:
- DOM Level 3
-
renameNode
DOM Level 3 Renaming node- Specified by:
renameNode
in interfaceDocument
- Throws:
DOMException
-
normalizeDocument
public void normalizeDocument()DOM Level 3 Normalize document.- Specified by:
normalizeDocument
in interfaceDocument
-
getDomConfig
The configuration used whenDocument.normalizeDocument
is invoked.- Specified by:
getDomConfig
in interfaceDocument
- Since:
- DOM Level 3
-
setDocumentURI
DOM Level 3- Specified by:
setDocumentURI
in interfaceDocument
-
getDocumentURI
DOM Level 3 The location of the document ornull
if undefined.
Beware that when theDocument
supports the feature "HTML" , the href attribute of the HTML BASE element takes precedence over this attribute.- Specified by:
getDocumentURI
in interfaceDocument
- Since:
- DOM Level 3
-
getActualEncoding
DOM Level 3 An attribute specifying the actual encoding of this document. This isnull
otherwise.
This attribute represents the property [character encoding scheme] defined in .- Since:
- DOM Level 3
-
setActualEncoding
DOM Level 3 An attribute specifying the actual encoding of this document. This isnull
otherwise.
This attribute represents the property [character encoding scheme] defined in .- Since:
- DOM Level 3
-
replaceWholeText
DOM Level 3- Specified by:
replaceWholeText
in interfaceText
- Throws:
DOMException
-
getWholeText
DOM Level 3 Returns all text ofText
nodes logically-adjacent text nodes to this node, concatenated in document order.- Specified by:
getWholeText
in interfaceText
- Since:
- DOM Level 3
-
isElementContentWhitespace
public boolean isElementContentWhitespace()DOM Level 3 Returns whether this text node contains whitespace in element content, often abusively called "ignorable whitespace".- Specified by:
isElementContentWhitespace
in interfaceText
-
setIdAttribute
public void setIdAttribute(boolean id) NON-DOM: set the type of this attribute to be ID type.- Parameters:
id
-
-
setIdAttribute
DOM Level 3: register the given attribute node as an ID attribute- Specified by:
setIdAttribute
in interfaceElement
-
setIdAttributeNode
DOM Level 3: register the given attribute node as an ID attribute- Specified by:
setIdAttributeNode
in interfaceElement
-
setIdAttributeNS
DOM Level 3: register the given attribute node as an ID attribute- Specified by:
setIdAttributeNS
in interfaceElement
-
getSchemaTypeInfo
- Specified by:
getSchemaTypeInfo
in interfaceAttr
- Specified by:
getSchemaTypeInfo
in interfaceElement
-
isId
public boolean isId() -
getXmlEncoding
- Specified by:
getXmlEncoding
in interfaceDocument
-
setXmlEncoding
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalone
in interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalone
in interfaceDocument
- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersion
in interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersion
in interfaceDocument
- Throws:
DOMException
-