True
if the width can be decreased. Otherwise False
.True
if the spacing can be decreased. Otherwise False
.true
, then a new paragraph with same formatting will be inserted.
Otherwise, only the inlines from that paragraph will be inserted.true
.NodeList
.
Implementations should raise other exceptions under other circumstances.
For example, implementations should raise an implementation-dependent
exception if a null
argument is passed.
Some languages and object systems do not support the concept of exceptions. For such systems, error conditions may be indicated using native error reporting mechanisms. For some bindings, for example, methods may return error codes similar to those listed in the corresponding method descriptions.
See also the Document Object Model (DOM) Level 2 Core Specification.
Attr
interface represents an attribute in an
Element
object. Typically the allowable values for the
attribute are defined in a document type definition.
Attr
objects inherit the Node
interface, but
since they are not actually child nodes of the element they describe, the
DOM does not consider them part of the document tree. Thus, the
Node
attributes parentNode
,
previousSibling
, and nextSibling
have a
null
value for Attr
objects. The DOM takes the
view that attributes are properties of elements rather than having a
separate identity from the elements they are associated with; this should
make it more efficient to implement such features as default attributes
associated with all elements of a given type. Furthermore,
Attr
nodes may not be immediate children of a
DocumentFragment
. However, they can be associated with
Element
nodes contained within a
DocumentFragment
. In short, users and implementors of the
DOM need to be aware that Attr
nodes have some things in
common with other objects inheriting the Node
interface, but
they also are quite distinct.
The attribute's effective value is determined as follows: if this
attribute has been explicitly assigned any value, that value is the
attribute's effective value; otherwise, if there is a declaration for
this attribute, and that declaration includes a default value, then that
default value is the attribute's effective value; otherwise, the
attribute does not exist on this element in the structure model until it
has been explicitly added. Note that the nodeValue
attribute
on the Attr
instance can also be used to retrieve the string
version of the attribute's value(s).
In XML, where the value of an attribute can contain entity references,
the child nodes of the Attr
node may be either
Text
or EntityReference
nodes (when these are
in use; see the description of EntityReference
for
discussion). Because the DOM Core is not aware of attribute types, it
treats all attribute values as simple strings, even if the DTD or schema
declares them as having tokenized types.
See also the Document Object Model (DOM) Level 2 Core Specification.
true
; otherwise, it is
false
. Note that the implementation is in charge of this
attribute, not the user. If the user changes the value of the
attribute (even if it ends up having the same value as the default
value) then the specified
flag is automatically flipped
to true
. To re-specify the attribute as the default
value from the DTD, the user must delete the attribute. The
implementation will then make a new attribute available with
specified
set to false
and the default
value (if one exists).
specified
is true
, and the value is
the assigned value. If the attribute has no assigned value in the
document and has a default value in the DTD, then
specified
is false
, and the value is the
default value in the DTD. If the attribute has no assigned value in
the document and has a value of #IMPLIED in the DTD, then the
attribute does not appear in the structure model of the document. If
the ownerElement
attribute is null
(i.e.
because it was just created or was set to null
by the
various removal and cloning operations) specified
is
true
.
getAttribute
on the
Element
interface.
Text
node with the unparsed
contents of the string. I.e. any characters that an XML processor
would recognize as markup are instead treated as literal text. See
also the method setAttribute
on the Element
interface.
Element
node this attribute is attached to or
null
if this attribute is not in use.The DOMString
attribute of the Text
node holds
the text that is contained by the CDATA section. Note that this may
contain characters that need to be escaped outside of CDATA sections and
that, depending on the character encoding ("charset") chosen for
serialization, it may be impossible to write out some characters as part
of a CDATA section.
The CDATASection
interface inherits from the
CharacterData
interface through the Text
interface. Adjacent CDATASection
nodes are not merged by use
of the normalize
method of the Node
interface.
Because no markup is recognized within a CDATASection
,
character numeric references cannot be used as an escape mechanism when
serializing. Therefore, action needs to be taken when serializing a
CDATASection
with a character encoding where some of the
contained characters cannot be represented. Failure to do so would not
produce well-formed XML.One potential solution in the serialization
process is to end the CDATA section before the character, output the
character using a character reference or entity reference, and open a new
CDATA section for any further characters in the text node. Note, however,
that some code conversion libraries at the time of writing do not return
an error or exception when a character is missing from the encoding,
making the task of ensuring that data is not corrupted on serialization
more difficult.
See also the Document Object Model (DOM) Level 2 Core Specification.
CharacterData
interface extends Node with a set of
attributes and methods for accessing character data in the DOM. For
clarity this set is defined here rather than on each object that uses
these attributes and methods. No DOM objects correspond directly to
CharacterData
, though Text
and others do
inherit the interface from it. All offsets
in this interface
start from 0
.
As explained in the DOMString
interface, text strings in
the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In
the following, the term 16-bit units is used whenever necessary to
indicate that indexing on CharacterData is done in 16-bit units.
See also the Document Object Model (DOM) Level 2 Core Specification.
CharacterData
node. However,
implementation limits may mean that the entirety of a node's data may
not fit into a single DOMString
. In such cases, the user
may call substringData
to retrieve the data in
appropriately sized pieces.
DOMString
variable on the implementation
platform.
data
and the substringData
method below. This may have the
value zero, i.e., CharacterData
nodes may be empty.
offset
and
count
exceeds the length
, then all 16-bit
units to the end of the data are returned.
offset
is
negative or greater than the number of 16-bit units in
data
, or if the specified count
is
negative.
DOMString
.
data
provides access to the concatenation of
data
and the DOMString
specified.
DOMString
to append.
DOMString
to insert.
offset
is
negative or greater than the number of 16-bit units in
data
.
data
and length
reflect the change.
offset
and count
exceeds
length
then all 16-bit units from offset
to the end of the data are deleted.
offset
is
negative or greater than the number of 16-bit units in
data
, or if the specified count
is
negative.
offset
and count
exceeds
length
, then all 16-bit units to the end of the data
are replaced; (i.e., the effect is the same as a remove
method call with the same range, followed by an append
method invocation).
The DOMString
with which the range must be
replaced.
offset
is
negative or greater than the number of 16-bit units in
data
, or if the specified count
is
negative.
CharacterData
and represents the
content of a comment, i.e., all the characters between the starting '
<!--
' and ending '-->
'. Note that this is
the definition of a comment in XML, and, in practice, HTML, although some
HTML tools may implement the full SGML comment structure.
See also the Document Object Model (DOM) Level 2 Core Specification.
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.
See also the Document Object Model (DOM) Level 2 Core Specification.
DocumentType
)
associated with this document. For HTML documents as well as XML
documents without a document type declaration this returns
null
. The DOM Level 2 does not support editing the
Document Type Declaration. docType
cannot be altered in
any way, including through the use of methods inherited from the
Node
interface, such as insertNode
or
removeNode
.
DOMImplementation
object that handles this document. A
DOM application may use objects from multiple implementations.
Element
interface, so attributes
can be specified directly on the returned object.
Attr
nodes representing them are automatically created
and attached to the element.
createElementNS
method.
tagName
parameter may be provided in any case, but it must be mapped to the
canonical uppercase form by the DOM implementation.
Element
object with the
nodeName
attribute set to tagName
, and
localName
, prefix
, and
namespaceURI
set to null
.
DocumentFragment
object.DocumentFragment
.Text
node given the specified string.Text
object.Comment
node given the specified string.Comment
object.CDATASection
node whose value is the specified
string.CDATASection
contents.
CDATASection
object.ProcessingInstruction
node given the specified
name and data strings.ProcessingInstruction
object.Attr
of the given name. Note that the
Attr
instance can then be set on an Element
using the setAttributeNode
method.
createAttributeNS
method.
Attr
object with the nodeName
attribute set to name
, and localName
,
prefix
, and namespaceURI
set to
null
. The value of the attribute is the empty string.
EntityReference
object. In addition, if the
referenced entity is known, the child list of the
EntityReference
node is made the same as that of the
corresponding Entity
node.If any descendant of the
Entity
node has an unbound namespace prefix, the
corresponding descendant of the created EntityReference
node is also unbound; (its namespaceURI
is
null
). The DOM Level 2 does not support any mechanism to
resolve namespace prefixes.
EntityReference
object.NodeList
of all the Elements
with a
given tag name in the order in which they are encountered in a
preorder traversal of the Document
tree.
NodeList
object containing all the matched
Elements
.
parentNode
is null
).
The source node is not altered or removed from the original document;
this method creates a new copy of the source node.
nodeName
and nodeType
, plus the
attributes related to namespaces (prefix
,
localName
, and namespaceURI
). As in the
cloneNode
operation on a Node
, the source
node is not altered.
nodeType
, attempting to mirror the behavior expected if
a fragment of XML or HTML source was copied from one document to
another, recognizing that the two documents may have different DTDs
in the XML case. The following list describes the specifics for each
type of node.
ownerElement
attribute
is set to null
and the specified
flag is
set to true
on the generated Attr
. The
descendants of the source Attr
are recursively imported
and the resulting nodes reassembled to form the corresponding subtree.
Note that the deep
parameter has no effect on
Attr
nodes; they always carry their children with them
when imported.deep
option
was set to true
, the descendants of the source element
are recursively imported and the resulting nodes reassembled to form
the corresponding subtree. Otherwise, this simply generates an empty
DocumentFragment
.Document
nodes cannot be imported.DocumentType
nodes cannot be imported.Attr
nodes are attached to the generated Element
. Default
attributes are not copied, though if the document being imported into
defines default attributes for this element name, those are assigned.
If the importNode
deep
parameter was set to
true
, the descendants of the source element are
recursively imported and the resulting nodes reassembled to form the
corresponding subtree.Entity
nodes can be
imported, however in the current release of the DOM the
DocumentType
is readonly. Ability to add these imported
nodes to a DocumentType
will be considered for addition
to a future release of the DOM.On import, the publicId
,
systemId
, and notationName
attributes are
copied. If a deep
import is requested, the descendants
of the the source Entity
are recursively imported and
the resulting nodes reassembled to form the corresponding subtree.EntityReference
itself is
copied, even if a deep
import is requested, since the
source and destination documents might have defined the entity
differently. If the document being imported into provides a
definition for this entity name, its value is assigned.Notation
nodes can be imported, however in the current
release of the DOM the DocumentType
is readonly. Ability
to add these imported nodes to a DocumentType
will be
considered for addition to a future release of the DOM.On import, the
publicId
and systemId
attributes are copied.
Note that the deep
parameter has no effect on
Notation
nodes since they never have any children.target
and data
values from those of the
source node.CharacterData
copy their
data
and length
attributes from those of
the source node.true
, recursively import the subtree under
the specified node; if false
, import only the node
itself, as explained above. This has no effect on Attr
, EntityReference
, and Notation
nodes.
Document
.Element
object with the following
attributes:AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted
from qualifiedName
, or null
if there is
no prefixNode.localName
local name, extracted from
qualifiedName
Element.tagName
qualifiedName
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, or if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace" .
Attr
object with the following attributes:
AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted from
qualifiedName
, or null
if there is no
prefixNode.localName
local name, extracted from
qualifiedName
Attr.name
qualifiedName
Node.nodeValue
the empty
string
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace", or if the
qualifiedName
is "xmlns" and the
namespaceURI
is different from "
http://www.w3.org/2000/xmlns/".
NodeList
of all the Elements
with a
given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document
tree.
NodeList
object containing all the matched
Elements
.
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
. 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
.
id
value for an element.
DocumentFragment
is a "lightweight" or "minimal"
Document
object. It is very common to want to be able to
extract a portion of a document's tree or to create a new fragment of a
document. Imagine implementing a user command like cut or rearranging a
document by moving fragments around. It is desirable to have an object
which can hold such fragments and it is quite natural to use a Node for
this purpose. While it is true that a Document
object could
fulfill this role, a Document
object can potentially be a
heavyweight object, depending on the underlying implementation. What is
really needed for this is a very lightweight object.
DocumentFragment
is such an object.
Furthermore, various operations -- such as inserting nodes as children
of another Node
-- may take DocumentFragment
objects as arguments; this results in all the child nodes of the
DocumentFragment
being moved to the child list of this node.
The children of a DocumentFragment
node are zero or more
nodes representing the tops of any sub-trees defining the structure of
the document. DocumentFragment
nodes do not need to be
well-formed XML documents (although they do need to follow the rules
imposed upon well-formed XML parsed entities, which can have multiple top
nodes). For example, a DocumentFragment
might have only one
child and that child node could be a Text
node. Such a
structure model represents neither an HTML document nor a well-formed XML
document.
When a DocumentFragment
is inserted into a
Document
(or indeed any other Node
that may
take children) the children of the DocumentFragment
and not
the DocumentFragment
itself are inserted into the
Node
. This makes the DocumentFragment
very
useful when the user wishes to create nodes that are siblings; the
DocumentFragment
acts as the parent of these nodes so that
the user can use the standard methods from the Node
interface, such as insertBefore
and appendChild
.
See also the Document Object Model (DOM) Level 2 Core Specification.
Document
has a doctype
attribute whose value
is either null
or a DocumentType
object. The
DocumentType
interface in the DOM Core provides an interface
to the list of entities that are defined for the document, and little
else because the effect of namespaces and the various XML schema efforts
on DTD representation are not clearly understood as of this writing.
The DOM Level 2 doesn't support editing DocumentType
nodes.
See also the Document Object Model (DOM) Level 2 Core Specification.
DOCTYPE
keyword.
NamedNodeMap
containing the general entities, both
external and internal, declared in the DTD. Parameter entities are
not contained. Duplicates are discarded. For example in:
<!DOCTYPE ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar "bar"> <!ENTITY bar "bar2"> <!ENTITY % baz "baz"> ]> <ex/>the interface provides access to
foo
and the first declaration of bar
but not the second
declaration of bar
or baz
. Every node in
this map also implements the Entity
interface.
entities
cannot be altered in any way.
NamedNodeMap
containing the notations declared in the
DTD. Duplicates are discarded. Every node in this map also implements
the Notation
interface.
notations
cannot be altered in any way.
DOMImplementation
interface provides a number of methods
for performing operations that are independent of any particular instance
of the document object model.
See also the Document Object Model (DOM) Level 2 Core Specification.
true
.
true
if the feature is implemented in the
specified version, false
otherwise.DocumentType
node. Entity declarations
and notations are not made available. Entity reference expansions and
default attribute additions do not occur. It is expected that a
future version of the DOM will provide a way for populating a
DocumentType
.
DocumentType
node with
Node.ownerDocument
set to null
.
qualifiedName
is
malformed.
Document
object of the specified type with
its document element. HTML-only DOM implementations do not need to
implement this method.
null
.
When doctype
is not null
, its
Node.ownerDocument
attribute is set to the document
being created.
Document
object.qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, or if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace" .
doctype
has already
been used with a different document or was created from a different
implementation.
Element
interface represents an element in an HTML or XML
document. Elements may have attributes associated with them; since the
Element
interface inherits from Node
, the
generic Node
interface attribute attributes
may
be used to retrieve the set of all attributes for an element. There are
methods on the Element
interface to retrieve either an
Attr
object by name or an attribute value by name. In XML,
where an attribute value may contain entity references, an
Attr
object should be retrieved to examine the possibly
fairly complex sub-tree representing the attribute value. On the other
hand, in HTML, where all attributes have simple string values, methods to
directly access an attribute value can safely be used as a convenience.In
DOM Level 2, the method normalize
is inherited from the
Node
interface where it was moved.
See also the Document Object Model (DOM) Level 2 Core Specification.
<elementExample id="demo"> ... </elementExample> ,
tagName
has
the value "elementExample"
. Note that this is
case-preserving in XML, as are all of the operations of the DOM. The
HTML DOM returns the tagName
of an HTML element in the
canonical uppercase form, regardless of the case in the source HTML
document.
Attr
value as a string, or the empty string
if that attribute does not have a specified or default value.
Attr
node plus any
Text
and EntityReference
nodes, build the
appropriate subtree, and use setAttributeNode
to assign
it as the value of an attribute.
setAttributeNS
method.
removeAttributeNS
method.
getAttributeNodeNS
method.
nodeName
) of the attribute to retrieve.
Attr
node with the specified name (nodeName
)
or null
if there is no such attribute.
nodeName
) is already present in the element, it is
replaced by the new one.
setAttributeNodeNS
method.
Attr
node to add to the attribute list.
newAttr
attribute replaces an existing
attribute, the replaced Attr
node is returned,
otherwise null
is returned.
newAttr
was created from a
different document than the one that created the element.
newAttr
is already an
attribute of another Element
object. The DOM user must
explicitly clone Attr
nodes to re-use them in other
elements.
Attr
has a default value it is immediately replaced. The replacing
attribute has the same namespace URI and local name, as well as the
original prefix, when applicable.
Attr
node to remove from the attribute
list.
Attr
node that was removed.oldAttr
is not an attribute
of the element.
NodeList
of all descendant Elements
with a given tag name, in the order in which they are encountered in
a preorder traversal of this Element
tree.
Element
nodes.Attr
value as a string, or the empty string
if that attribute does not have a specified or default value.
qualifiedName
, and
its value is changed to be the value
parameter. This
value is a simple string; it is not parsed as it is being set. So any
markup (such as syntax to be recognized as an entity reference) is
treated as literal text, and needs to be appropriately escaped by the
implementation when it is written out. In order to assign an
attribute value that contains entity references, the user must create
an Attr
node plus any Text
and
EntityReference
nodes, build the appropriate subtree,
and use setAttributeNodeNS
or
setAttributeNode
to assign it as the value of an
attribute.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace", or if the
qualifiedName
is "xmlns" and the
namespaceURI
is different from "
http://www.w3.org/2000/xmlns/".
Attr
node by local name and namespace URI.
HTML-only DOM implementations do not need to implement this method.
Attr
node with the specified attribute local
name and namespace URI or null
if there is no such
attribute.
Attr
node to add to the attribute list.
newAttr
attribute replaces an existing
attribute with the same local name and namespace URI, the replaced
Attr
node is returned, otherwise null
is
returned.
newAttr
was created from a
different document than the one that created the element.
newAttr
is already an
attribute of another Element
object. The DOM user must
explicitly clone Attr
nodes to re-use them in other
elements.
NodeList
of all the descendant
Elements
with a given local name and namespace URI in
the order in which they are encountered in a preorder traversal of
this Element
tree.
NodeList
object containing all the matched
Elements
.
true
when an attribute with a given name is
specified on this element or has a default value, false
otherwise.
true
if an attribute with the given name is
specified on this element or has a default value, false
otherwise.
true
when an attribute with a given local name and
namespace URI is specified on this element or has a default value,
false
otherwise. HTML-only DOM implementations do not
need to implement this method.
true
if an attribute with the given local name
and namespace URI is specified or has a default value on this
element, false
otherwise.
EntityReference
objects may be inserted into the structure
model when an entity reference is in the source document, or when the
user wishes to insert an entity reference. Note that character references
and references to predefined entities are considered to be expanded by
the HTML or XML processor so that characters are represented by their
Unicode equivalent rather than by an entity reference. Moreover, the XML
processor may completely expand references to entities while building the
structure model, instead of providing EntityReference
objects. If it does provide such objects, then for a given
EntityReference
node, it may be that there is no
Entity
node representing the referenced entity. If such an
Entity
exists, then the subtree of the
EntityReference
node is in general a copy of the
Entity
node subtree. However, this may not be true when an
entity contains an unbound namespace prefix. In such a case, because the
namespace prefix resolution depends on where the entity reference is, the
descendants of the EntityReference
node may be bound to
different namespace URIs.
As for Entity
nodes, EntityReference
nodes and
all their descendants are readonly.
See also the Document Object Model (DOM) Level 2 Core Specification.
NamedNodeMap
interface are used to
represent collections of nodes that can be accessed by name. Note that
NamedNodeMap
does not inherit from NodeList
;
NamedNodeMaps
are not maintained in any particular order.
Objects contained in an object implementing NamedNodeMap
may
also be accessed by an ordinal index, but this is simply to allow
convenient enumeration of the contents of a NamedNodeMap
,
and does not imply that the DOM specifies an order to these Nodes.
NamedNodeMap
objects in the DOM are live.
See also the Document Object Model (DOM) Level 2 Core Specification.
0
to length-1
inclusive.
nodeName
of a node to retrieve.
Node
(of any type) with the specified
nodeName
, or null
if it does not identify
any node in this map.
nodeName
attribute. If a node with
that name is already present in this map, it is replaced by the new
one.
nodeName
attribute is used to derive the name
which the node must be stored under, multiple nodes of certain types
(those that have a "special" string value) cannot be stored as the
names would clash. This is seen as preferable to allowing nodes to be
aliased.
nodeName
attribute.
Node
replaces an existing node the
replaced Node
is returned, otherwise null
is returned.
arg
was created from a
different document than the one that created this map.
arg
is an
Attr
that is already an attribute of another
Element
object. The DOM user must explicitly clone
Attr
nodes to re-use them in other elements.
nodeName
of the node to remove.
name
in
this map.
index
th item in the map. If index
is greater than or equal to the number of nodes in this map, this
returns null
.
index
th position in the map, or
null
if that is not a valid index.
Node
(of any type) with the specified local
name and namespace URI, or null
if they do not
identify any node in this map.
namespaceURI
and
localName
. If a node with that namespace URI and that
local name is already present in this map, it is replaced by the new
one.
namespaceURI
and
localName
attributes.
Node
replaces an existing node the
replaced Node
is returned, otherwise null
is returned.
arg
was created from a
different document than the one that created this map.
arg
is an
Attr
that is already an attribute of another
Element
object. The DOM user must explicitly clone
Attr
nodes to re-use them in other elements.
Node
interface. If so, an attribute
immediately appears containing the default value as well as the
corresponding namespace URI, local name, and prefix when applicable.
namespaceURI
and localName
in this map.
Node
interface is the primary datatype for the entire
Document Object Model. It represents a single node in the document tree.
While all objects implementing the Node
interface expose
methods for dealing with children, not all objects implementing the
Node
interface may have children. For example,
Text
nodes may not have children, and adding children to
such nodes results in a DOMException
being raised.
The attributes nodeName
, nodeValue
and
attributes
are included as a mechanism to get at node
information without casting down to the specific derived interface. In
cases where there is no obvious mapping of these attributes for a
specific nodeType
(e.g., nodeValue
for an
Element
or attributes
for a Comment
), this returns null
. Note that the specialized interfaces
may contain additional and more convenient mechanisms to get and set the
relevant information.
See also the Document Object Model (DOM) Level 2 Core Specification.
null
, setting it has no effect.
DOMString
variable on the implementation
platform.
Attr
,
Document
, DocumentFragment
,
Entity
, and Notation
may have a parent.
However, if a node has just been created and not yet added to the
tree, or if it has been removed from the tree, this is
null
.
NodeList
that contains all children of this node. If
there are no children, this is a NodeList
containing no
nodes.
null
.
null
.
null
.
null
.
NamedNodeMap
containing the attributes of this node (if
it is an Element
) or null
otherwise.
Document
object associated with this node. This is
also the Document
object used to create new nodes. When
this node is a Document
or a DocumentType
which is not used with any Document
yet, this is
null
.
null
if it is
unspecified.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.Per
the Namespaces in XML Specification an attribute does not inherit
its namespace from the element it is attached to. If an attribute is
not explicitly given a namespace, it simply has no namespace.
null
if it is
unspecified.
nodeName
attribute, which holds the qualified name, as
well as the tagName
and name
attributes of
the Element
and Attr
interfaces, when
applicable.
namespaceURI
and localName
do not change.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.
prefix
is
malformed, if the namespaceURI
of this node is
null
, if the specified prefix is "xml" and the
namespaceURI
of this node is different from "
http://www.w3.org/XML/1998/namespace", if this node is an attribute
and the specified prefix is "xmlns" and the
namespaceURI
of this node is different from "
http://www.w3.org/2000/xmlns/", or if this node is an attribute and
the qualifiedName
of this node is "xmlns" .
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.
newChild
before the existing child node
refChild
. If refChild
is null
,
insert newChild
at the end of the list of children.
newChild
is a DocumentFragment
object,
all of its children are inserted, in the same order, before
refChild
. If the newChild
is already in the
tree, it is first removed.
newChild
node, or if
the node to insert is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
refChild
is not a child of
this node.
oldChild
with newChild
in the list of children, and returns the oldChild
node.
newChild
is a DocumentFragment
object,
oldChild
is replaced by all of the
DocumentFragment
children, which are inserted in the
same order. If the newChild
is already in the tree, it
is first removed.
newChild
node, or if
the node to put in is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
oldChild
is not a child of
this node.
oldChild
from the list
of children, and returns it.
oldChild
is not a child of
this node.
newChild
to the end of the list of children
of this node. If the newChild
is already in the tree, it
is first removed.
DocumentFragment
object, the entire contents of the document fragment are moved
into the child list of this node
newChild
node, or if
the node to append is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
true
if this node has any children,
false
otherwise.
parentNode
is null
.).
Element
copies all attributes and their
values, including those generated by the XML processor to represent
defaulted attributes, but this method does not copy any text it
contains unless it is a deep clone, since the text is contained in a
child Text
node. Cloning an Attribute
directly, as opposed to be cloned as part of an Element
cloning operation, returns a specified attribute (
specified
is true
). Cloning any other type
of node simply returns a copy of this node.
EntityReference
clone are readonly
. In addition, clones of unspecified Attr
nodes are
specified. And, cloning Document
,
DocumentType
, Entity
, and
Notation
nodes is implementation dependent.
true
, recursively clone the subtree under
the specified node; if false
, clone only the node
itself (and its attributes, if it is an Element
).
Text
nodes in the full depth of the sub-tree
underneath this Node
, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text
nodes, i.e., there are neither adjacent
Text
nodes nor empty Text
nodes. This can
be used to ensure that the DOM view of a document is the same as if
it were saved and re-loaded, and is useful when operations (such as
XPointer lookups) that depend on a particular document tree
structure are to be used.In cases where the document contains
CDATASections
, the normalize operation alone may not be
sufficient, since XPointers do not differentiate between
Text
nodes and CDATASection
nodes.
hasFeature
on
DOMImplementation
.
This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true
.
true
if the specified feature is
supported on this node, false
otherwise.
true
if this node has any attributes,
false
otherwise.
NodeList
interface provides the abstraction of an ordered
collection of nodes, without defining or constraining how this collection
is implemented. NodeList
objects in the DOM are live.
The items in the NodeList
are accessible via an integral
index, starting from 0.
See also the Document Object Model (DOM) Level 2 Core Specification.
length-1
inclusive.
index
th item in the collection. If
index
is greater than or equal to the number of nodes in
the list, this returns null
.
index
th position in the
NodeList
, or null
if that is not a valid
index.
ProcessingInstruction
interface represents a "processing
instruction", used in XML as a way to keep processor-specific information
in the text of the document.
See also the Document Object Model (DOM) Level 2 Core Specification.
?>
.
Text
interface inherits from CharacterData
and represents the textual content (termed character data in XML) of an
Element
or Attr
. If there is no markup inside
an element's content, the text is contained in a single object
implementing the Text
interface that is the only child of
the element. If there is markup, it is parsed into the information items
(elements, comments, etc.) and Text
nodes that form the list
of children of the element.
When a document is first made available via the DOM, there is only one
Text
node for each block of text. Users may create adjacent
Text
nodes that represent the contents of a given element
without any intervening markup, but should be aware that there is no way
to represent the separations between these nodes in XML or HTML, so they
will not (in general) persist between DOM editing sessions. The
normalize()
method on Node
merges any such
adjacent Text
objects into a single node for each block of
text.
See also the Document Object Model (DOM) Level 2 Core Specification.
offset
,
keeping both in the tree as siblings. After being split, this node
will contain all the content up to the offset
point. A
new node of the same type, which contains all the content at and
after the offset
point, is returned. If the original
node had a parent node, the new node is inserted as the next sibling
of the original node. When the offset
is equal to the
length of this node, the new node has no data.
0
.
data
.
Element
.Attr
.Text
node.CDATASection
.EntityReference
.Entity
.ProcessingInstruction
.Comment
.Document
.DocumentType
.DocumentFragment
.Notation
.The items in the NodeList
are accessible via an integral
index, starting from 0.
The items in the NodeList
are accessible via an integral
index, starting from 0.
HTML parser and pretty printer
(c) 1998-2000 (W3C) MIT, INRIA, Keio University See HtmlParser.cs for the copyright notice. Derived from HTML HtmlParser Release 4 Aug 2000
Copyright (c) 1998-2000 World Wide Web Consortium (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
Contributing Author(s):
Dave Raggett
Andy Quick (translation to Java)
Seth Yates (translation to C#)
The contributing author(s) would like to thank all those who helped with testing, bug fixes, and patience. This wouldn't have been possible without all of you.
COPYRIGHT NOTICE:
This software and documentation is provided "as is," and
the copyright holders and contributing author(s) make no
representations or warranties, express or implied, including
but not limited to, warranties of merchantability or fitness
for any particular purpose or that the use of the software or
documentation will not infringe any third party patents,
copyrights, trademarks or other rights.
The copyright holders and contributing author(s) will not be liable for any direct, indirect, special or consequential damages arising out of any use of the software or documentation, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, documentation and executables, for any purpose, without fee, subject to the following restrictions:
The copyright holders and contributing author(s) specifically permit, without fee, and encourage the use of this source code as a component for supporting the Hypertext Markup Language in commercial products. If you use this source code in a product, acknowledgment is not required but would be appreciated.
xml:space
attribute is found, then if the attribute value is
preserve
, returns true
. For any other value, returns
false
. If an xml:space
attribute was not
found, then the following element names result in a return value of true:
pre, script, style,
and xsl:text
. Finally, if a
TagTable
was passed in and the element appears as the "pre" element
in the TagTable
, then true
will be returned.
Otherwise, false
is returned.
Node
to test to see if whitespace should be
preserved.
The TagTable
to test for the getNodePre()
function. This may be null
, in which case this test
is bypassed.
true
or false
, as explained above.
string
values
are equal.
@param value1 The left-hand side of the encoded {@link string#equals(Object)}.
@param value2 The right-hand side of the encoded {@link string#equals(Object)}.
@return true
if the encoded string
s are equal;
false
otherwise.
@see #isDoubleMetaphoneEqual(string,string,bool)
string
values
are equal, optionally using the alternate value.
@param value1 The left-hand side of the encoded {@link string#equals(Object)}.
@param value2 The right-hand side of the encoded {@link string#equals(Object)}.
@param alternate use the alternate value if true
.
@return true
if the encoded string
s are equal;
false
otherwise.
true
if the value starts with any of 'GN', 'KN',
'PN', 'WR' or 'PS'.
index
if available, otherwise
it returns Character.MIN_VALUE
so that there is some sort
of a default
value
contains any of the criteria
starting
* at index start
and matching up to length length