|
BEA Systems, Inc. | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectweblogic.apache.xerces.dom.NodeImpl
weblogic.apache.xerces.dom.ChildNode
weblogic.apache.xerces.dom.ParentNode
weblogic.apache.xerces.dom.CoreDocumentImpl
The 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.
The CoreDocumentImpl class only implements the DOM Core. Additional modules are supported by the more complete DocumentImpl subclass.
Note: When any node in the document is serialized, the entire document is serialized along with it.
| Field Summary | |
protected String |
actualEncoding
Deprecated. Experimental DOM Level 3 feature: Document actualEncoding |
protected boolean |
allowGrammarAccess
Deprecated. Allow grammar access. |
protected static short |
CDATA
Deprecated. |
protected int |
changes
Deprecated. Number of alterations made to this document since its creation. |
protected static short |
COMMENTS
Deprecated. |
protected static short |
DEFAULTS
Deprecated. |
protected ElementImpl |
docElement
Deprecated. Document element. |
protected DocumentTypeImpl |
docType
Deprecated. Document type. |
protected DOMNormalizer |
domNormalizer
Deprecated. |
protected static short |
DTNORMALIZATION
Deprecated. |
protected String |
encoding
Deprecated. Experimental DOM Level 3 feature: Document encoding |
protected static short |
ENTITIES
Deprecated. |
protected boolean |
errorChecking
Deprecated. Bypass error checking. |
protected DOMValidationConfiguration |
fConfiguration
Deprecated. |
protected String |
fDocumentURI
Deprecated. Experimental DOM Level 3 feature: documentURI |
protected short |
features
Deprecated. Normalization features |
protected XMLEntityResolver |
fEntityResolver
Deprecated. |
protected DOMErrorHandlerWrapper |
fErrorHandlerWrapper
Deprecated. Experimental DOM Level 3 feature: errorHandler |
protected Grammar |
fGrammar
Deprecated. |
protected ShadowedSymbolTable |
fSymbolTable
Deprecated. |
protected Hashtable |
identifiers
Deprecated. Identifiers. |
protected static short |
NAMESPACES
Deprecated. |
protected static short |
SPLITCDATA
Deprecated. |
protected boolean |
standalone
Deprecated. Experimental DOM Level 3 feature: Document standalone |
protected Hashtable |
userData
Deprecated. Table for user data attached to this document nodes. |
protected static short |
VALIDATION
Deprecated. |
protected String |
version
Deprecated. Experimental DOM Level 3 feature: Document version |
| Fields inherited from class weblogic.apache.xerces.dom.ParentNode |
firstChild, fNodeListCache, ownerDocument |
| Fields inherited from class weblogic.apache.xerces.dom.ChildNode |
nextSibling, previousSibling |
| Fields inherited from class weblogic.apache.xerces.dom.NodeImpl |
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, IDATTRIBUTE, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, UNNORMALIZED |
| Constructor Summary | |
CoreDocumentImpl()
Deprecated. NON-DOM: Actually creating a Document is outside the DOM's spec, since it has to operate in terms of a particular implementation. |
|
CoreDocumentImpl(boolean grammarAccess)
Deprecated. Constructor. |
|
CoreDocumentImpl(DocumentType doctype)
Deprecated. For DOM2 support. |
|
CoreDocumentImpl(DocumentType doctype,
boolean grammarAccess)
Deprecated. For DOM2 support. |
|
| Method Summary | |
void |
abort()
Deprecated. DOM Level 3 WD - Experimental. |
protected void |
addEventListener(NodeImpl node,
String type,
EventListener listener,
boolean useCapture)
Deprecated. |
Node |
adoptNode(Node source)
Deprecated. DOM Level 3 WD - Experimental Change the node's ownerDocument, and its subtree, to this Document |
boolean |
canSetNormalizationFeature(String name,
boolean state)
Deprecated. DOM Level 3 WD - Experimental. |
protected void |
changed()
Deprecated. Denotes that this node has changed. |
protected int |
changes()
Deprecated. Returns the number of changes to this node. |
Object |
clone()
Deprecated. Clone. |
Node |
cloneNode(boolean deep)
Deprecated. Deep-clone a document, including fixing ownerDoc for the cloned children. |
protected void |
cloneNode(CoreDocumentImpl newdoc,
boolean deep)
Deprecated. internal method to share code with subclass |
void |
copyConfigurationProperties(XMLParserConfiguration config)
Deprecated. NON-DOM: copy configuration properties from the parsing configuration. |
protected void |
copyEventListeners(NodeImpl src,
NodeImpl tgt)
Deprecated. |
Attr |
createAttribute(String name)
Deprecated. Factory method; creates an Attribute having this Document as its OwnerDoc. |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
Deprecated. Introduced in DOM Level 2. |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName,
String localName)
Deprecated. Xerces-specific constructor. |
CDATASection |
createCDATASection(String data)
Deprecated. Factory method; creates a CDATASection having this Document as its OwnerDoc. |
Comment |
createComment(String data)
Deprecated. Factory method; creates a Comment having this Document as its OwnerDoc. |
DocumentFragment |
createDocumentFragment()
Deprecated. Factory method; creates a DocumentFragment having this Document as its OwnerDoc. |
DocumentType |
createDocumentType(String qualifiedName,
String publicID,
String systemID)
Deprecated. NON-DOM Factory method; creates a DocumentType having this Document as its OwnerDoc. |
Element |
createElement(String tagName)
Deprecated. Factory method; creates an Element having this Document as its OwnerDoc. |
ElementDefinitionImpl |
createElementDefinition(String name)
Deprecated. NON-DOM Factory method: creates an element definition. |
Element |
createElementNS(String namespaceURI,
String qualifiedName)
Deprecated. Introduced in DOM Level 2. |
Element |
createElementNS(String namespaceURI,
String qualifiedName,
String localpart)
Deprecated. NON-DOM: Xerces-specific constructor. |
Entity |
createEntity(String name)
Deprecated. NON-DOM Factory method; creates an Entity having this Document as its OwnerDoc. |
EntityReference |
createEntityReference(String name)
Deprecated. Factory method; creates an EntityReference having this Document as its OwnerDoc. |
Notation |
createNotation(String name)
Deprecated. NON-DOM Factory method; creates a Notation having this Document as its OwnerDoc. |
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
Deprecated. Factory method; creates a ProcessingInstruction having this Document as its OwnerDoc. |
Text |
createTextNode(String data)
Deprecated. Factory method; creates a Text node having this Document as its OwnerDoc. |
protected boolean |
dispatchEvent(NodeImpl node,
Event event)
Deprecated. |
void |
finalize()
Deprecated. Call user data handlers to let them know the nodes they are related to are being deleted. |
String |
getActualEncoding()
Deprecated. DOM Level 3 WD - Experimental. |
boolean |
getAsync()
Deprecated. DOM Level 3 WD - Experimental. |
String |
getBaseURI()
Deprecated. DOM Level 3 WD - Experimental. |
DocumentType |
getDoctype()
Deprecated. For XML, this provides access to the Document Type Definition. |
Element |
getDocumentElement()
Deprecated. Convenience method, allowing direct access to the child node which is considered the root of the actual document content. |
String |
getDocumentURI()
Deprecated. DOM Level 3 WD - Experimental. |
Element |
getElementById(String elementId)
Deprecated. Introduced in DOM Level 2 Returns the Element whose ID is given by elementId. |
NodeList |
getElementsByTagName(String tagname)
Deprecated. Return a live collection of all descendent Elements (not just immediate children) having the specified tag name. |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
Deprecated. Introduced in DOM Level 2. |
String |
getEncoding()
Deprecated. DOM Level 3 WD - Experimental. |
boolean |
getErrorChecking()
Deprecated. Returns true if the DOM implementation performs error checking. |
org.apache.xerces.dom3.DOMErrorHandler |
getErrorHandler()
Deprecated. DOM Level 3 WD - Experimental. |
Element |
getIdentifier(String idName)
Deprecated. Returns a previously registered element with the specified identifier name, or null if no element is registered. |
Enumeration |
getIdentifiers()
Deprecated. Returns an enumeration registered of identifier names. |
DOMImplementation |
getImplementation()
Deprecated. Retrieve information describing the abilities of this particular DOM implementation. |
String |
getNodeName()
Deprecated. Returns the node name. |
short |
getNodeType()
Deprecated. Returns the node type. |
boolean |
getNormalizationFeature(String name)
Deprecated. DOM Level 3 WD - Experimental. |
Document |
getOwnerDocument()
Deprecated. Find the Document that this Node belongs to (the document in whose context the Node was created). |
boolean |
getStandalone()
Deprecated. DOM Level 3 WD - Experimental. |
boolean |
getStrictErrorChecking()
Deprecated. |
String |
getTextContent()
Deprecated. This attribute returns the text content of this node and its descendants. |
protected Object |
getUserData(NodeImpl n)
Deprecated. NON-DOM: kept for backward compatibility Retreive user data related to a given node |
Object |
getUserData(Node n,
String key)
Deprecated. Retrieves the object associated to a key on a this node. |
String |
getVersion()
Deprecated. DOM Level 3 WD - Experimental. |
Node |
importNode(Node source,
boolean deep)
Deprecated. Copies a node from another document to this document. |
Node |
insertBefore(Node newChild,
Node refChild)
Deprecated. Since a Document may contain at most one top-level Element child, and at most one DocumentType declaraction, we need to subclass our add-children methods to implement this constraint. |
protected boolean |
isKidOK(Node parent,
Node child)
Deprecated. Uses the kidOK lookup table to check whether the proposed tree structure is legal. |
protected boolean |
isNormalizeDocRequired()
Deprecated. |
static boolean |
isXMLName(String s)
Deprecated. Check the string against XML's definition of acceptable names for elements and attributes and so on using the XMLCharacterProperties utility class |
boolean |
load(String uri)
Deprecated. DOM Level 3 WD - Experimental. |
boolean |
loadXML(String source)
Deprecated. DOM Level 3 WD - Experimental. |
void |
normalizeDocument()
Deprecated. DOM Level 3 WD - Experimental Normalize document. |
void |
putIdentifier(String idName,
Element element)
Deprecated. Registers an identifier name with a specified element node. |
Node |
removeChild(Node oldChild)
Deprecated. Since insertBefore caches the docElement (and, currently, docType), removeChild has to know how to undo the cache REVISIT: According to the spec it is not allowed to alter neither the document element nor the document type in any way |
protected void |
removeEventListener(NodeImpl node,
String type,
EventListener listener,
boolean useCapture)
Deprecated. |
void |
removeIdentifier(String idName)
Deprecated. Removes a previously registered element with the specified identifier name. |
Node |
renameNode(Node n,
String namespaceURI,
String name)
Deprecated. DOM Level 3 WD - Experimental. |
Node |
replaceChild(Node newChild,
Node oldChild)
Deprecated. Since we cache the docElement (and, currently, docType), replaceChild has to update the cache REVISIT: According to the spec it is not allowed to alter neither the document element nor the document type in any way |
String |
saveXML(Node snode)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setActualEncoding(String value)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setAsync(boolean async)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setDocumentURI(String documentURI)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setEncoding(String value)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setErrorChecking(boolean check)
Deprecated. Sets whether the DOM implementation performs error checking upon operations. |
void |
setErrorHandler(org.apache.xerces.dom3.DOMErrorHandler errorHandler)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setNormalizationFeature(String name,
boolean state)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setStandalone(boolean value)
Deprecated. DOM Level 3 WD - Experimental. |
void |
setStrictErrorChecking(boolean check)
Deprecated. |
void |
setTextContent(String textContent)
Deprecated. This attribute returns the text content of this node and its descendants. |
protected void |
setUserData(NodeImpl n,
Object data)
Deprecated. NON-DOM: kept for backward compatibility Store user data related to a given node This is a place where we could use weak references! Indeed, the node here won't be GC'ed as long as some user data is attached to it, since the userData table will have a reference to the node. |
Object |
setUserData(Node n,
String key,
Object data,
org.apache.xerces.dom3.UserDataHandler handler)
Deprecated. Associate an object to a key on this node. |
void |
setVersion(String value)
Deprecated. DOM Level 3 WD - Experimental. |
| Methods inherited from class weblogic.apache.xerces.dom.ParentNode |
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, hasChildNodes, isEqualNode, item, normalize, setReadOnly, synchronizeChildren |
| Methods inherited from class weblogic.apache.xerces.dom.ChildNode |
getNextSibling, getParentNode, getPreviousSibling |
| Methods inherited from class weblogic.apache.xerces.dom.NodeImpl |
addEventListener, appendChild, compareTreePosition, dispatchEvent, getAttributes, getInterface, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, hasAttributes, isDefaultNamespace, isSameNode, isSupported, lookupNamespacePrefix, lookupNamespaceURI, needsSyncChildren, removeEventListener, setNodeValue, setPrefix, setUserData, setUserData, synchronizeData, toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getUserData, hasAttributes, hasChildNodes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, normalize, setNodeValue, setPrefix |
| Field Detail |
protected String actualEncoding
protected boolean allowGrammarAccess
protected static final short CDATA
protected int changes
Any method that alters the tree structure MUST cause or be accompanied by a call to changed(), to inform it that any outstanding NodeLists may have to be updated.
(Required because NodeList is simultaneously "live" and integer- indexed -- a bad decision in the DOM's design.)
Note that changes which do not affect the tree's structure -- changing the node's name, for example -- do _not_ have to call changed().
Alternative implementation would be to use a cryptographic Digest value rather than a count. This would have the advantage that "harmless" changes (those producing equal() trees) would not force NodeList to resynchronize. Disadvantage is that it's slightly more prone to "false negatives", though that's the difference between "wildly unlikely" and "absurdly unlikely". IF we start maintaining digests, we should consider taking advantage of them. Note: This used to be done a node basis, so that we knew what subtree changed. But since only DeepNodeList really use this today, the gain appears to be really small compared to the cost of having an int on every (parent) node plus having to walk up the tree all the way to the root to mark the branch as changed everytime a node is changed. So we now have a single counter global to the document. It means that some objects may flush their cache more often than necessary, but this makes nodes smaller and only the document needs to be marked as changed.
protected static final short COMMENTS
protected static final short DEFAULTS
protected ElementImpl docElement
protected DocumentTypeImpl docType
protected DOMNormalizer domNormalizer
protected static final short DTNORMALIZATION
protected String encoding
protected static final short ENTITIES
protected boolean errorChecking
protected DOMValidationConfiguration fConfiguration
protected String fDocumentURI
protected short features
protected XMLEntityResolver fEntityResolver
protected final transient DOMErrorHandlerWrapper fErrorHandlerWrapper
protected Grammar fGrammar
protected ShadowedSymbolTable fSymbolTable
protected Hashtable identifiers
protected static final short NAMESPACES
protected static final short SPLITCDATA
protected boolean standalone
protected Hashtable userData
protected static final short VALIDATION
protected String version
| Constructor Detail |
public CoreDocumentImpl()
public CoreDocumentImpl(boolean grammarAccess)
public CoreDocumentImpl(DocumentType doctype)
public CoreDocumentImpl(DocumentType doctype,
boolean grammarAccess)
| Method Detail |
public void abort()
load being invoked the loading and parsing is
immediately aborted. The possibly partial result of parsing the
document is discarded and the document is cleared.
abort in interface DocumentLS
protected void addEventListener(NodeImpl node,
String type,
EventListener listener,
boolean useCapture)
public Node adoptNode(Node source)
adoptNode in interface Documentsource - The node to adopt.importNode(org.w3c.dom.Node, boolean)
public boolean canSetNormalizationFeature(String name,
boolean state)
protected void changed()
changed in class NodeImplprotected int changes()
changes in class NodeImpl
public Object clone()
throws CloneNotSupportedException
CloneNotSupportedExceptionpublic Node cloneNode(boolean deep)
cloneNode in interface NodecloneNode in class ParentNodedeep - boolean, iff true replicate children
protected void cloneNode(CoreDocumentImpl newdoc,
boolean deep)
public void copyConfigurationProperties(XMLParserConfiguration config)
protected void copyEventListeners(NodeImpl src,
NodeImpl tgt)
public Attr createAttribute(String name)
throws DOMException
createAttribute in interface Documentname - The name of the attribute. Note that the attribute's value
is _not_ established at the factory; remember to set it!
DOMException(INVALID_NAME_ERR) - if the attribute name is not
acceptable.
DOMException
public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
throws DOMException
Creates an attribute 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].
createAttributeNS in interface DocumentnamespaceURI - The namespace URI of the attribute to
create. When it is null or an empty string,
this method behaves like createAttribute.qualifiedName - The qualified name of the attribute to
instantiate.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.
public Attr createAttributeNS(String namespaceURI,
String qualifiedName,
String localName)
throws DOMException
namespaceURI - The namespace URI of the attribute to
create. When it is null or an empty string,
this method behaves like createAttribute.qualifiedName - The qualified name of the attribute to
instantiate.localName - The local name of the attribute to instantiate.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.
public CDATASection createCDATASection(String data)
throws DOMException
createCDATASection in interface Documentdata - The initial contents of the CDATA
DOMException(NOT_SUPPORTED_ERR) - for HTML documents. (HTML
not yet implemented.)
DOMExceptionpublic Comment createComment(String data)
createComment in interface Documentdata - The initial contents of the Comment.public DocumentFragment createDocumentFragment()
createDocumentFragment in interface Document
public DocumentType createDocumentType(String qualifiedName,
String publicID,
String systemID)
throws DOMException
DOMException(NOT_SUPPORTED_ERR) - for HTML documents, where
DTDs are not permitted. (HTML not yet implemented.)
DOMException
public Element createElement(String tagName)
throws DOMException
createElement in interface DocumenttagName - 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(INVALID_NAME_ERR) - if the tag name is not
acceptable.
DOMException
public ElementDefinitionImpl createElementDefinition(String name)
throws DOMException
DOMException
public Element createElementNS(String namespaceURI,
String qualifiedName)
throws DOMException
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].
createElementNS in interface DocumentnamespaceURI - The namespace URI of the element to
create.qualifiedName - The qualified name of the element type to
instantiate.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.
DOMException - NAMESPACE_ERR: Raised if the qualifiedName has a
prefix that is "xml" and the namespaceURI is
neither null nor an empty string nor
"http://www.w3.org/XML/1998/namespace", or
if the qualifiedName has a prefix different
from "xml" and the namespaceURI is null or an
empty string.
public Element createElementNS(String namespaceURI,
String qualifiedName,
String localpart)
throws DOMException
namespaceURI - The namespace URI of the element to
create.qualifiedName - The qualified name of the element type to
instantiate.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.
public Entity createEntity(String name)
throws DOMException
name - The name of the Entity we wish to provide a value for.
DOMException(NOT_SUPPORTED_ERR) - for HTML documents, where
nonstandard entities are not permitted. (HTML not yet
implemented.)
DOMException
public EntityReference createEntityReference(String name)
throws DOMException
createEntityReference in interface Documentname - The name of the Entity we wish to refer to
DOMException(NOT_SUPPORTED_ERR) - for HTML documents, where
nonstandard entities are not permitted. (HTML not yet
implemented.)
DOMException
public Notation createNotation(String name)
throws DOMException
name - The name of the Notation we wish to describe
DOMException(NOT_SUPPORTED_ERR) - for HTML documents, where
notations are not permitted. (HTML not yet
implemented.)
DOMException
public ProcessingInstruction createProcessingInstruction(String target,
String data)
throws DOMException
createProcessingInstruction in interface Documenttarget - The target "processor channel"data - Parameter string to be passed to the target.
DOMException(INVALID_NAME_ERR) - if the target name is not
acceptable.
DOMException(NOT_SUPPORTED_ERR) - for HTML documents. (HTML
not yet implemented.)
DOMExceptionpublic Text createTextNode(String data)
createTextNode in interface Documentdata - The initial contents of the Text.
protected boolean dispatchEvent(NodeImpl node,
Event event)
public void finalize()
public String getActualEncoding()
null otherwise.
public boolean getAsync()
true
the load method returns control to the caller before the document has
completed loading. The default value of this property is
false.
false but we
need to check with Mozilla and IE.
getAsync in interface DocumentLSpublic String getBaseURI()
getBaseURI in interface NodegetBaseURI in class NodeImplpublic DocumentType getDoctype()
getDoctype in interface Documentpublic Element getDocumentElement()
getDocumentElement in interface Documentpublic String getDocumentURI()
null if undefined.
Document supports the feature
"HTML" , the href attribute of the HTML BASE element takes precedence
over this attribute.
getDocumentURI in interface Documentpublic Element getElementById(String elementId)
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.
getElementById in interface DocumentgetIdentifier(java.lang.String)public NodeList getElementsByTagName(String tagname)
getElementsByTagName in interface Documenttagname - The type of Element we want to gather. "*" will be
taken as a wildcard, meaning "all elements in the document."DeepNodeListImpl
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
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.
getElementsByTagNameNS in interface DocumentnamespaceURI - 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.
public String getEncoding()
public boolean getErrorChecking()
public org.apache.xerces.dom3.DOMErrorHandler getErrorHandler()
public Element getIdentifier(String idName)
putIdentifier(java.lang.String, org.w3c.dom.Element),
removeIdentifier(java.lang.String)public Enumeration getIdentifiers()
public DOMImplementation getImplementation()
getImplementation in interface Documentpublic String getNodeName()
getNodeName in interface NodegetNodeName in class NodeImplpublic short getNodeType()
getNodeType in interface NodegetNodeType in class NodeImpl
public boolean getNormalizationFeature(String name)
throws DOMException
DOMExceptionpublic final Document getOwnerDocument()
ParentNode
getOwnerDocument in interface NodegetOwnerDocument in class ParentNodepublic boolean getStandalone()
public boolean getStrictErrorChecking()
getStrictErrorChecking in interface Document
public String getTextContent()
throws DOMException
NodeImplText 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.
| 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 nodes |
| ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE |
nodeValue |
| DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE | null |
getTextContent in interface NodegetTextContent in class ParentNodeDOMExceptionprotected Object getUserData(NodeImpl n)
public Object getUserData(Node n,
String key)
setUserData with the same key.
n - The node the object is associated to.key - The key the object is associated to.
DOMObject associated to the given key
on this node, or null if there was none.public String getVersion()
public Node importNode(Node source,
boolean deep)
throws DOMException
According to the DOM specifications, document nodes cannot be imported and a NOT_SUPPORTED_ERR exception is thrown if attempted.
importNode in interface DocumentDOMException
public Node insertBefore(Node newChild,
Node refChild)
throws DOMException
While I'm doing so, I've taken advantage of the opportunity to cache documentElement and docType so we don't have to search for them. REVISIT: According to the spec it is not allowed to alter neither the document element nor the document type in any way
insertBefore in interface NodeinsertBefore in class ParentNodenewChild - The Node to be moved to our subtree. As a
convenience feature, inserting a DocumentNode will instead insert
all its children.refChild - Current child which newChild should be placed
immediately before. If refChild is null, the insertion occurs
after all existing Nodes, like appendChild().
DOMException
protected boolean isKidOK(Node parent,
Node child)
protected boolean isNormalizeDocRequired()
public static boolean isXMLName(String s)
public boolean load(String uri)
ParseErrorEvent).
load in interface DocumentLSuri - The URI reference for the XML file to be loaded. If this is
a relative URI...
true load returns
true if the document load was successfully initiated.
If an error occurred when initiating the document load
load returns false.If async is set to
false load returns true if
the document was successfully loaded and parsed. If an error
occurred when either loading or parsing the URI load
returns false.public boolean loadXML(String source)
loadXML in interface DocumentLSsource - A string containing an XML document.
true if parsing the input string succeeded
without errors, otherwise false.public void normalizeDocument()
normalizeDocument in interface Document
public void putIdentifier(String idName,
Element element)
getIdentifier(java.lang.String),
removeIdentifier(java.lang.String)
public Node removeChild(Node oldChild)
throws DOMException
removeChild in interface NoderemoveChild in class ParentNodeDOMException
protected void removeEventListener(NodeImpl node,
String type,
EventListener listener,
boolean useCapture)
public void removeIdentifier(String idName)
putIdentifier(java.lang.String, org.w3c.dom.Element),
getIdentifier(java.lang.String)
public Node renameNode(Node n,
String namespaceURI,
String name)
throws DOMException
renameNode in interface DocumentDOMException
public Node replaceChild(Node newChild,
Node oldChild)
throws DOMException
replaceChild in interface NodereplaceChild in class ParentNodeDOMException
public String saveXML(Node snode)
throws DOMException
saveXML in interface DocumentLSsnode - Specifies what to serialize, if this parameter is
null the whole document is serialized, if it's
non-null the given node is serialized.
null.
DOMException - WRONG_DOCUMENT_ERR: Raised if the node passed in as the node
parameter is from an other document.public void setActualEncoding(String value)
null otherwise.
public void setAsync(boolean async)
true
the load method returns control to the caller before the document has
completed loading. The default value of this property is
false.
false but we
need to check with Mozilla and IE.
setAsync in interface DocumentLSpublic void setDocumentURI(String documentURI)
setDocumentURI in interface Documentpublic void setEncoding(String value)
public void setErrorChecking(boolean check)
Turning off error checking does not turn off the following checks:
public void setErrorHandler(org.apache.xerces.dom3.DOMErrorHandler errorHandler)
public void setNormalizationFeature(String name,
boolean state)
throws DOMException
DOMExceptionpublic void setStandalone(boolean value)
public void setStrictErrorChecking(boolean check)
setStrictErrorChecking in interface Document
public void setTextContent(String textContent)
throws DOMException
NodeImplText 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.
| 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 nodes |
| ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE |
nodeValue |
| DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE | null |
setTextContent in interface NodesetTextContent in class ParentNodeDOMException
protected void setUserData(NodeImpl n,
Object data)
public Object setUserData(Node n,
String key,
Object data,
org.apache.xerces.dom3.UserDataHandler handler)
getUserData with the
same key.
n - The node to associate the object to.key - The key to associate the object to.data - The object to associate to the given key, or
null to remove any existing association to that key.handler - The handler to associate to that key, or
null.
DOMObject previously associated to
the given key on this node, or null if there was none.public void setVersion(String value)
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs90 Copyright 2005 BEA Systems Inc. |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||