|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Document3
interface is an extension to the DOM Level 2
Document
interface containing the DOM Level 3 additions.
See also the Document Object Model (DOM) Level 3 Core Specification.
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Method Summary | |
org.w3c.dom.Node |
adoptNode(org.w3c.dom.Node source)
Changes the ownerDocument of a node, its children, as well
as the attached attribute nodes if there are any. |
boolean |
canSetNormalizationFeature(java.lang.String name,
boolean state)
Query whether setting a feature to a specific value is supported. |
java.lang.String |
getActualEncoding()
An attribute specifying the actual encoding of this document. |
java.lang.String |
getDocumentURI()
The location of the document or null if undefined. |
java.lang.String |
getEncoding()
An attribute specifying, as part of the XML declaration, the encoding of this document. |
DOMErrorHandler |
getErrorHandler()
This attribute allows applications to specify a DOMErrorHandler to be called in the event that an error
is encountered while performing an operation on a document. |
boolean |
getNormalizationFeature(java.lang.String name)
Look up the value of a feature. |
boolean |
getStandalone()
An attribute specifying, as part of the XML declaration, whether this document is standalone. |
boolean |
getStrictErrorChecking()
An attribute specifying whether errors checking is enforced or not. |
java.lang.String |
getVersion()
An attribute specifying, as part of the XML declaration, the version number of this document. |
void |
normalizeDocument()
This method acts as if the document was going through a save and load cycle, putting the document in a "normal" form. |
org.w3c.dom.Node |
renameNode(org.w3c.dom.Node n,
java.lang.String namespaceURI,
java.lang.String name)
Rename an existing node. |
void |
setActualEncoding(java.lang.String actualEncoding)
An attribute specifying the actual encoding of this document. |
void |
setDocumentURI(java.lang.String documentURI)
The location of the document or null if undefined. |
void |
setEncoding(java.lang.String encoding)
An attribute specifying, as part of the XML declaration, the encoding of this document. |
void |
setErrorHandler(DOMErrorHandler errorHandler)
This attribute allows applications to specify a DOMErrorHandler to be called in the event that an error
is encountered while performing an operation on a document. |
void |
setNormalizationFeature(java.lang.String name,
boolean state)
Set the state of a feature. |
void |
setStandalone(boolean standalone)
An attribute specifying, as part of the XML declaration, whether this document is standalone. |
void |
setStrictErrorChecking(boolean strictErrorChecking)
An attribute specifying whether errors checking is enforced or not. |
void |
setVersion(java.lang.String version)
An attribute specifying, as part of the XML declaration, the version number of this document. |
Methods inherited from interface org.w3c.dom.Document |
createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode |
Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Method Detail |
public java.lang.String getActualEncoding()
null
otherwise.
public void setActualEncoding(java.lang.String actualEncoding)
null
otherwise.
public java.lang.String getEncoding()
null
when unspecified.public void setEncoding(java.lang.String encoding)
null
when unspecified.public boolean getStandalone()
public void setStandalone(boolean standalone)
public java.lang.String getVersion()
null
when unspecified.
public void setVersion(java.lang.String version)
null
when unspecified.
public boolean getStrictErrorChecking()
false
, the implementation is free to not
test every possible error case normally defined on DOM operations,
and not raise any DOMException
. In case of error, the
behavior is undefined. This attribute is true
by
defaults.public void setStrictErrorChecking(boolean strictErrorChecking)
false
, the implementation is free to not
test every possible error case normally defined on DOM operations,
and not raise any DOMException
. In case of error, the
behavior is undefined. This attribute is true
by
defaults.public DOMErrorHandler getErrorHandler()
DOMErrorHandler
to be called in the event that an error
is encountered while performing an operation on a document. Note that
not all methods use this mechanism, see the description of each
method for details.public void setErrorHandler(DOMErrorHandler errorHandler)
DOMErrorHandler
to be called in the event that an error
is encountered while performing an operation on a document. Note that
not all methods use this mechanism, see the description of each
method for details.public java.lang.String getDocumentURI()
null
if undefined.
Document
supports the feature
"HTML" , the href attribute of the HTML BASE element takes precedence
over this attribute.public void setDocumentURI(java.lang.String documentURI)
null
if undefined.
Document
supports the feature
"HTML" , the href attribute of the HTML BASE element takes precedence
over this attribute.public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws org.w3c.dom.DOMException
ownerDocument
of a node, its children, as well
as the attached attribute nodes if there are any. If the node has a
parent it is first removed from its parent child list. This
effectively allows moving a subtree from one document to another. 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 adopted Attr
. The descendants
of the source Attr
are recursively adopted.Document
nodes cannot
be adopted.DocumentType
nodes cannot
be adopted.Attr
nodes.
Default attributes are discarded, though if the document being
adopted into defines default attributes for this element name, those
are assigned. The descendants of the source element are recursively
adopted.Entity
nodes cannot be adopted.EntityReference
node
itself is adopted, the descendants are discarded, 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 cannot be adopted.source
- The node to move into this document.null
if this operation
fails, such as when the source node comes from a different
implementation.org.w3c.dom.DOMException
- NOT_SUPPORTED_ERR: Raised if the source node is of type
DOCUMENT
, DOCUMENT_TYPE
.
public void normalizeDocument()
setNormalizeFeature
for details.
Text
nodes, makes
the document "namespace wellformed", according to the algorithm
described below in pseudo code, by adding missing namespace
declaration attributes and adding or changing namespace prefixes,
updates the replacement tree of EntityReference
nodes,
normalizes attribute values, etc.
public boolean canSetNormalizationFeature(java.lang.String name, boolean state)
hasFeature
string.name
- The name of the feature to check.state
- The requested state of the feature (true
or
false
).true
if the feature could be successfully set to
the specified value, or false
if the feature is not
recognized or the requested value is not supported. This does not
change the current value of the feature itself.public void setNormalizationFeature(java.lang.String name, boolean state) throws org.w3c.dom.DOMException
hasFeature
string.
Document
to recognize a feature
name but to be unable to set its value.Need to specify the list of
features.name
- The name of the feature to set.state
- The requested state of the feature (true
or
false
).org.w3c.dom.DOMException
- NOT_SUPPORTED_ERR: Raised when the feature name is recognized but the
requested value cannot be set.
public boolean getNormalizationFeature(java.lang.String name) throws org.w3c.dom.DOMException
hasFeature
stringname
- The name of the feature to look up.true
or
false
).org.w3c.dom.DOMException
- NOT_FOUND_ERR: Raised when the feature name is not recognized.public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, java.lang.String namespaceURI, java.lang.String name) throws org.w3c.dom.DOMException
ELEMENT_NODE
and ATTRIBUTE_NODE
.
Element
its attributes are moved to the new node, the
new node is inserted at the position the old node used to have in its
parent's child nodes list if it has one, the user data that was
attached to the old node is attach to the new node, the user data
event NODE_RENAMED
is fired.
Attr
that is
attached to an Element
, the node is first removed from
the Element
attributes map. Then, once renamed, either
by modifying the existing node or creating a new one as described
above, it is put back.
ElementNameChanged
or AttributeNameChanged
is fired.Should this throw a HIERARCHY_REQUEST_ERR?n
- The node to rename.namespaceURI
- The new namespaceURI.name
- The new qualified name.org.w3c.dom.DOMException
- NOT_SUPPORTED_ERR: Raised when the type of the specified node is
neither ELEMENT_NODE
nor ATTRIBUTE_NODE
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |