- All Implemented Interfaces:
Cloneable,DocumentType,EventTarget,Node,NodeList
DocumentType is an Extended DOM feature, used in XML documents but not in HTML.
Note that Entities and Notations are no longer children of the DocumentType, but are parentless nodes hung only in their appropriate NamedNodeMaps.
This area is UNDERSPECIFIED IN REC-DOM-Level-1-19981001 Most notably, absolutely no provision was made for storing and using Element and Attribute information. Nor was the linkage between Entities and Entity References nailed down solidly.
- Author:
- Arnaud Le Hors, IBM, Joe Kesselman, IBM, Andy Clark, IBM
-
Field Summary
Fields inherited from class org.htmlunit.cyberneko.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocumentFields inherited from class org.htmlunit.cyberneko.xerces.dom.ChildNode
nextSibling_, previousSibling_Fields inherited from class org.htmlunit.cyberneko.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, FIRSTCHILD, HASSTRING, ID, NORMALIZED, OWNED, ownerNode_, READONLY, SPECIFIED, SYNCCHILDRENFields 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
ConstructorsConstructorDescriptionDocumentTypeImpl(CoreDocumentImpl ownerDocument, String name) Factory method for creating a document type node.DocumentTypeImpl(CoreDocumentImpl ownerDocument, String qualifiedName, String publicID, String systemID) -
Method Summary
Modifier and TypeMethodDescriptioncloneNode(boolean deep) Returns a duplicate of a given node.Access the collection of general Entities, both external and internal, defined in the DTD.Introduced in DOM Level 2.getName()Name of this document type.Returns the name of this node.protected intReturns the node number.shortA short integer indicating what type of node this is.Access the collection of Notations defined in the DTD.Introduced in DOM Level 2.Introduced in DOM Level 2.Get Node text contentgetUserData(String key) booleanisEqualNode(Node arg) DOM Level 3 WD- Experimental.voidsetInternalSubset(String internalSubset) protected voidNON-DOM set the ownerDocument of this node and its childrenvoidsetTextContent(String textContent) Set Node text contentsetUserData(String key, Object data, UserDataHandler handler) Methods inherited from class org.htmlunit.cyberneko.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, hasChildNodes, insertBefore, item, removeChild, replaceChild, synchronizeChildrenMethods inherited from class org.htmlunit.cyberneko.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSiblingMethods inherited from class org.htmlunit.cyberneko.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, dispatchEvent, getAttributes, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeValue, getPrefix, hasAttributes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, normalize, removeEventListener, setNodeValue, setPrefix, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Node
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix
-
Constructor Details
-
DocumentTypeImpl
Factory method for creating a document type node.- Parameters:
ownerDocument- the owner documentname- the name
-
DocumentTypeImpl
public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String qualifiedName, String publicID, String systemID)
-
-
Method Details
-
getPublicId
Introduced in DOM Level 2.Return the public identifier of this Document type.
- Specified by:
getPublicIdin interfaceDocumentType
-
getSystemId
Introduced in DOM Level 2.Return the system identifier of this Document type.
- Specified by:
getSystemIdin interfaceDocumentType
-
setInternalSubset
-
getInternalSubset
Introduced in DOM Level 2.Return the internalSubset given as a string.
- Specified by:
getInternalSubsetin interfaceDocumentType
-
getNodeType
public short getNodeType()A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface. A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface.- Specified by:
getNodeTypein interfaceNode- Specified by:
getNodeTypein classNodeImpl
-
getNodeName
Returns the name of this node.- Specified by:
getNodeNamein interfaceNode- Specified by:
getNodeNamein classNodeImpl
-
cloneNode
Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other.Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior.
Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other.Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior. Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other.
Example: Cloning a Text node will copy both the node and the text it contains.
Example: Cloning something that has children -- Element or Attr, for example -- will _not_ clone those children unless a "deep clone" has been requested. A shallow clone of an Attr node will yield an empty Attr of the same name.
NOTE: Clones will always be read/write, even if the node being cloned is read-only, to permit applications using only the DOM API to obtain editable copies of locked portions of the tree.
Clones the node.- Specified by:
cloneNodein interfaceNode- Overrides:
cloneNodein classParentNode- Parameters:
deep- whether to recursively clone all children in the subtree- Returns:
- the cloned node
- See Also:
-
getTextContent
Get Node text content- Specified by:
getTextContentin interfaceNode- Overrides:
getTextContentin classParentNode- Throws:
DOMException
-
setTextContent
Set Node text content- Specified by:
setTextContentin interfaceNode- Overrides:
setTextContentin classParentNode- Throws:
DOMException
-
isEqualNode
DOM Level 3 WD- Experimental. Override inherited behavior from NodeImpl to support deep equal. DOM Level 3 WD- Experimental. Override inherited behavior from ParentNodeImpl to support deep equal.- Specified by:
isEqualNodein interfaceNode- Overrides:
isEqualNodein classParentNode
-
setOwnerDocument
NON-DOM set the ownerDocument of this node and its children NON-DOM set the ownerDocument of this node and its children- Overrides:
setOwnerDocumentin classParentNode
-
getNodeNumber
protected int getNodeNumber()Returns the node number. NON-DOM Get the number associated with this doctype.- Overrides:
getNodeNumberin classNodeImpl- Returns:
- the node number
-
getName
Name of this document type. If we loaded from a DTD, this should be the name immediately following the DOCTYPE keyword.- Specified by:
getNamein interfaceDocumentType
-
getEntities
Access the collection of general Entities, both external and internal, defined in the DTD. For example, in:<!doctype example SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar "bar"> <!ENTITY % baz "baz"> ]>The Entities map includes foo and bar, but not baz. It is promised that only Nodes which are Entities will exist in this NamedNodeMap.
For HTML, this will always be null.
Note that "built in" entities such as & and < should be converted to their actual characters before being placed in the DOM's contained text, and should be converted back when the DOM is rendered as XML or HTML, and hence DO NOT appear here.
- Specified by:
getEntitiesin interfaceDocumentType
-
getNotations
Access the collection of Notations defined in the DTD. A notation declares, by name, the format of an XML unparsed entity or is used to formally declare a Processing Instruction target.- Specified by:
getNotationsin interfaceDocumentType
-
getElements
-
setUserData
- Specified by:
setUserDatain interfaceNode- Overrides:
setUserDatain classNodeImpl
-
getUserData
- Specified by:
getUserDatain interfaceNode- Overrides:
getUserDatain classNodeImpl
-