BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xalan.stree
Class DocumentTypeImpl

java.lang.Object
  |
  +--weblogic.apache.xml.utils.UnImplNode
        |
        +--weblogic.apache.xalan.stree.Child
              |
              +--weblogic.apache.xalan.stree.DocumentTypeImpl

public class DocumentTypeImpl
extends Child
implements org.w3c.dom.DocumentType, org.w3c.dom.NamedNodeMap

Class to hold information about a DocumentType node

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.


Fields inherited from class weblogic.apache.xalan.stree.Child
m_doc, m_parent
 
Method Summary
 org.w3c.dom.NamedNodeMap getEntities()
          A NamedNodeMap containing the general entities, both external and internal, declared in the DTD.
 java.lang.String getInternalSubset()
          The internal subset as a string.
 int getLength()
          The number of nodes in this map.
 java.lang.String getLocalName()
          Returns the local part of the qualified name of this node.
 java.lang.String getName()
          The name of DTD; i.e., the name immediately following the DOCTYPE keyword.
 org.w3c.dom.Node getNamedItem(java.lang.String name)
          Retrieves a node specified by name.
 org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          Retrieves a node specified by local name and namespace URI.
 java.lang.String getNodeName()
          Returns the node name.
 short getNodeType()
          A short integer indicating what type of node this is.
 org.w3c.dom.NamedNodeMap getNotations()
          A NamedNodeMap containing the notations declared in the DTD.
 java.lang.String getPublicId()
          The public identifier of the external subset.
 java.lang.String getSystemId()
          The system identifier of the external subset.
 org.w3c.dom.Node item(int index)
          Returns the indexth item in the map.
 org.w3c.dom.Node removeNamedItem(java.lang.String name)
          Removes a node specified by name.
 org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          Removes a node specified by local name and namespace URI.
 org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg)
          Adds a node using its nodeName attribute.
 org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
          Adds a node using its namespaceURI and localName.
 
Methods inherited from class weblogic.apache.xalan.stree.Child
dispatchCharactersEvent, getAttributes, getFirstChild, getLastChild, getLevel, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTagName, getTransformer, getUid, hasChildNodes, isComplete, isNamespaceNode, isSupported, setAttribute, setComplete, setDoc, setLevel, setParent, setUid, throwIfParseError, throwParseError
 
Methods inherited from class weblogic.apache.xml.utils.UnImplNode
appendChild, appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, error, error, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildNodes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getNodeValue, getOwnerElement, getSpecified, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertBefore, insertData, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.

Returns:
Document Type node type
Overrides:
getNodeType in class UnImplNode

getNodeName

public java.lang.String getNodeName()
Returns the node name.

Returns:
Document Type node name
Overrides:
getNodeName in class UnImplNode

getName

public java.lang.String getName()
The name of DTD; i.e., the name immediately following the DOCTYPE keyword.
Specified by:
getName in interface org.w3c.dom.DocumentType

Returns:
Document Type name

getLocalName

public java.lang.String getLocalName()
Returns the local part of the qualified name of this node.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, it is null.

Returns:
Document Type local name
Overrides:
getLocalName in class Child

getEntities

public org.w3c.dom.NamedNodeMap getEntities()
A 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.
The DOM Level 2 does not support editing entities, therefore entities cannot be altered in any way.
Specified by:
getEntities in interface org.w3c.dom.DocumentType

Returns:
both external and internal entities declared in the DTD

getNotations

public org.w3c.dom.NamedNodeMap getNotations()
A NamedNodeMap containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the Notation interface.
The DOM Level 2 does not support editing notations, therefore notations cannot be altered in any way.
Specified by:
getNotations in interface org.w3c.dom.DocumentType

Returns:
notations declared in the DTD

getPublicId

public java.lang.String getPublicId()
The public identifier of the external subset.
Specified by:
getPublicId in interface org.w3c.dom.DocumentType

Returns:
public identifier

getSystemId

public java.lang.String getSystemId()
The system identifier of the external subset.
Specified by:
getSystemId in interface org.w3c.dom.DocumentType

Returns:
system identifier

getInternalSubset

public java.lang.String getInternalSubset()
The internal subset as a string.
Specified by:
getInternalSubset in interface org.w3c.dom.DocumentType

Returns:
internal subset as a string

getNamedItem

public org.w3c.dom.Node getNamedItem(java.lang.String name)
Retrieves a node specified by name.
Specified by:
getNamedItem in interface org.w3c.dom.NamedNodeMap

Parameters:
nameThe - nodeName of a node to retrieve.
Returns:
A Node (of any type) with the specified nodeName, or null if it does not identify any node in this map.

setNamedItem

public org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg)
                              throws org.w3c.dom.DOMException
Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one.
As the 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.
Specified by:
setNamedItem in interface org.w3c.dom.NamedNodeMap

Parameters:
argA - node to store in this map. The node will later be accessible using the value of its nodeName attribute.
Returns:
If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned.
Throws:
org.w3c.dom.DOMException - WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
INUSE_ATTRIBUTE_ERR: Raised if 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.

removeNamedItem

public org.w3c.dom.Node removeNamedItem(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.
Specified by:
removeNamedItem in interface org.w3c.dom.NamedNodeMap

Parameters:
nameThe - nodeName of the node to remove.
Returns:
The node removed from this map if a node with such a name exists.
Throws:
org.w3c.dom.DOMException - NOT_FOUND_ERR: Raised if there is no node named name in this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

item

public org.w3c.dom.Node item(int index)
Returns the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns null.
Specified by:
item in interface org.w3c.dom.NamedNodeMap

Parameters:
indexIndex - into this map.
Returns:
The node at the indexth position in the map, or null if that is not a valid index.
Overrides:
item in class UnImplNode

getLength

public int getLength()
The number of nodes in this map. The range of valid child node indices is 0 to length-1 inclusive.
Specified by:
getLength in interface org.w3c.dom.NamedNodeMap

Overrides:
getLength in class UnImplNode

getNamedItemNS

public org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Retrieves a node specified by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.
Specified by:
getNamedItemNS in interface org.w3c.dom.NamedNodeMap

Parameters:
namespaceURIThe - namespace URI of the node to retrieve.
localNameThe - local name of the node to retrieve.
Returns:
A Node (of any type) with the specified local name and namespace URI, or null if they do not identify any node in this map.

setNamedItemNS

public org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
                                throws org.w3c.dom.DOMException
Adds a node using its 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.
HTML-only DOM implementations do not need to implement this method.
Specified by:
setNamedItemNS in interface org.w3c.dom.NamedNodeMap

Parameters:
argA - node to store in this map. The node will later be accessible using the value of its namespaceURI and localName attributes.
Returns:
If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned.
Throws:
org.w3c.dom.DOMException - WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
INUSE_ATTRIBUTE_ERR: Raised if 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.

removeNamedItemNS

public org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI,
                                          java.lang.String localName)
                                   throws org.w3c.dom.DOMException
Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value when this map contains the attributes attached to an element, as returned by the attributes attribute of the 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.
HTML-only DOM implementations do not need to implement this method.
Specified by:
removeNamedItemNS in interface org.w3c.dom.NamedNodeMap

Parameters:
namespaceURIThe - namespace URI of the node to remove.
localNameThe - local name of the node to remove.
Returns:
The node removed from this map if a node with such a local name and namespace URI exists.
Throws:
org.w3c.dom.DOMException - NOT_FOUND_ERR: Raised if there is no node with the specified namespaceURI and localName in this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.