oracle.xml.parser.v2
Class XMLDocument

java.lang.Object
  |
  +--oracle.xml.parser.v2.XMLNode
        |
        +--oracle.xml.parser.v2.XMLNSNode
              |
              +--oracle.xml.parser.v2.XMLElement
                    |
                    +--oracle.xml.parser.v2.XMLDocument

public class XMLDocument
extends XMLElement
implements Document, DocumentTraversal, java.io.Externalizable, CXMLConstants

This class implements the DOM Document interface, represents an entire XML document and serves the root of the Document Object Model tree. Each XML tag can either represent a node or a leaf of this tree.

According to the XML specification, the root of the tree consists of any combination of comments and processing instructions, but only one root element. A helper method getDocumentElement is provided as a short cut to finding the root element.

See Also:
Serialized Form

Fields inherited from class oracle.xml.parser.v2.XMLNode
ATTRDECL, Auto_Events, capturing, DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMSubtreeModified, ELEMENTDECL, noncapturing, RANGE_DELETE_EVENT, RANGE_DELETETEXT_EVENT, RANGE_INSERT_EVENT, RANGE_INSERTTEXT_EVENT, RANGE_REPLACE_EVENT, RANGE_SETTEXT_EVENT, TRAVERSAL_DELETE_EVENT, TRAVERSAL_REPLACE_EVENT, XMLDECL_NODE
 
Fields inherited from interface oracle.xml.comp.CXMLConstants
ATTR_DEF, ATTR_TOKEN, ATTRDECL_DEF, CDATA_DEF, CHAR_DEF, COMMENT_DEF, CXML_VERSION, cXMLFILE, cXMLFILE_LEN, DEBUG, DTD_DEF, ELEMENTDECL_DEF, END, ENTITY_DEF, ENTITYREF_DEF, META_ID_MAX, names, NOTATION_DEF, NS_DEF, NULLSTR, PI_DEF, PREFIX_DEF, TAG_DEF, TAG_TOKEN, TOKEN_ONLY, XMLDECL_DEF
 
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
 
Constructor Summary
XMLDocument()
          Creates an empty document.
 
Method Summary
TypeMethod
 void addID(java.lang.String name, XMLElement e)
          Add a ID Element associated with this document
 Node adoptNode(Node srcNode)
           
 Node appendChild(Node elem)
          Appends a new node to the document
 Node cloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 Attr createAttribute(java.lang.String name)
          Creates an Attr of the given name.
 Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
          Creates an attribute of the given qualified name and namespace URI.
 CDATASection createCDATASection(java.lang.String data)
          Creates a CDATASection node whose value is the specified string.
 Comment createComment(java.lang.String data)
          Creates a Comment node given the specified string.
 DocumentFragment createDocumentFragment()
          Creates an empty DocumentFragment object.
 Element createElement(java.lang.String tagName)
          Creates an element of the type specified.
 Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
          Creates an element of the given qualified name and namespace URI.
 EntityReference createEntityReference(java.lang.String name)
          Creates an EntityReference object.
 Event createEvent(java.lang.String type)
          Creates an event object of the specified type
 MutationEvent createMutationEvent(java.lang.String type)
           
 NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean expandEntityReferences)
          Creates a Node Iterator with specified root,flag which governs what type of nodes it should include in logical view, filter for filtering nodes, flag determining whether entity references and its descendants could be included
 ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
          Creates a ProcessingInstruction node given the specified name and data strings.
 Range createRange()
          Create a new Document Range Object ,with Start and End Boundary points at the begining of the document.
 Event createRangeEvent(java.lang.String type)
           
 Text createTextNode(java.lang.String data)
          Creates a Text node given the specified string.
 Event createTraversalEvent(java.lang.String type)
           
 TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean expandEntityReferences)
          Creates a Node Iterator with specified root,flag which governs what type of nodes it should include in logical view, filter for filtering nodes, flag determining whether entity references and its descendants could be included
 java.util.Vector expectedElements(Element e)
          Returns vector of element names that can be appended to the element.
 NamedNodeMap getAttributes()
          A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
 int getColumnNumber()
          Get column number debug information
 boolean getDebugMode()
          Get the debug flag
 DocumentType getDoctype()
          The Document Type Declaration (DTD) associated with this document.
 Element getDocumentElement()
          This is a convenience attribute that allows direct access to the child node that is the root element of the document.
 Element getElementById(java.lang.String elementId)
          Returns the Element whose ID is given by elementId.
 NodeList getElementsByTagName(java.lang.String tagname)
          Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree.
 NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
          Returns a 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.
 java.lang.String getEncoding()
          Retrieves the character encoding information.
 XMLElement getIDElement(java.lang.String idValue)
          Deprecated. As of DOM 2
 java.util.Hashtable getIDHashtable()
          Get the ID element hashtable in the XML DOM Tree
 DOMImplementation getImplementation()
          The DOMImplementation object that handles this document.
 int getLineNumber()
          Get line number debug information
 java.lang.String getLocalName()
          Gets the local Name for this element.
 java.lang.String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 short getNodeType()
          Gets a code representing the type of the underlying object
 Document getOwnerDocument()
          The Document object associated with this node.
 java.lang.String getStandalone()
          Retrieves the standalone information.
 java.lang.String getSystemId()
          Get the system id of the entity contain this node
 java.lang.String getText()
          Returns the non-marked-up text contained by this element.
 java.lang.String getVersion()
          Retrieves the version information.
 Node importNode(Node importedNode, boolean deep)
          Imports a node from another document to this document.
 Node insertBefore(Node newChild, Node refChild)
          Inserts the node newChild before the existing child node refChild.
 void print(java.io.OutputStream out)
          Writes the contents of this document to the given output stream.
 void print(java.io.OutputStream out, java.lang.String enc)
          Writes the contents of this document to the given output stream.
 void print(PrintDriver pd)
          Writes the contents of this document to the given output stream.
 void print(java.io.PrintWriter out)
          Writes the contents of this document to the given output stream.
 void printExternalDTD(java.io.OutputStream out)
          Writes the contents of this document to the given output stream.
 void printExternalDTD(java.io.OutputStream out, java.lang.String enc)
          Writes the contents of the external DTD to the given output stream.
 void printExternalDTD(java.io.PrintWriter out)
          Writes the contents of this document to the given output stream.
 void readExternal(java.io.ObjectInput inArg)
          This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
 void readExternal(oracle.xml.io.XMLObjectInput in, oracle.xml.comp.CXMLContext cxmlContext)
          This method restores the information written by writeExternal by reading the input stream and regenerating the objects as per the information of the input stream.
 Node removeChild(Node elem)
          removes the elem from this documents list of child nodes
 Node replaceChild(Node newChild, Node oldChild)
          Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
 void reportSAXEvents(ContentHandler cntHandler)
          Report SAX Events from a DOM Tree
 void setDoctype(java.lang.String rootname, java.lang.String sysid, java.lang.String pubid)
          Sets the doctype URI for the document
 void setEncoding(java.lang.String encoding)
          Sets the character encoding for output.
 void setLocale(java.util.Locale locale)
          Sets the locale for error reporting
 void setNodeContext(oracle.xml.util.NodeContext nctx)
           
 void setParsedDoctype(java.lang.String rootname, java.lang.String sysid, java.lang.String pubid)
          Sets the doctype object by parsing sysid
 void setStandalone(java.lang.String value)
          Sets the standalone information stored in the <?xml ...?> tag.
 void setVersion(java.lang.String version)
          Sets the version number stored in the <?xml ...?> tag.
 boolean validateElementContent(Element e)
          Validates the content of a element node.
 void writeExternal(java.io.ObjectOutput outArg)
          This method saves the state of the object by creating a binray compressed stream with information about this object.
 void writeExternal(oracle.xml.io.XMLObjectOutput out, oracle.xml.comp.CXMLContext cxmlContext)
          This method saves the state of the object by writing the object information in a binary compressed stream.
 
Methods inherited from class oracle.xml.parser.v2.XMLElement
getAttribute, getAttributeNode, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildrenByTagName, getChildrenByTagName, getElementsByTagName, getExpandedName, getFirstAttribute, getNamespace, getPrefix, getQualifiedName, getTagName, hasAttribute, hasAttributeNS, hasAttributes, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, resolveNamespacePrefix, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, validateContent, validateContent, validateContent
 
Methods inherited from class oracle.xml.parser.v2.XMLNSNode
addText, addText, getChildNodes, getFirstChild, getLastChild, getNodeLocalName, getNodeName, getNodePrefix, hasChildNodes, setPrefix
 
Methods inherited from class oracle.xml.parser.v2.XMLNode
addEventListener, dispatchEvent, getNextSibling, getNodeValue, getParentNode, getPreviousSibling, getProperty, isNodeFlag, isSupported, readChildNodes, removeEventListener, resetNodeFlag, selectNodes, selectNodes, selectNodes, selectSingleNode, selectSingleNode, setDebugInfo, setNodeFlag, setNodeValue, setProperty, supports, transformNode, valueOf, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDocument

public XMLDocument()
Creates an empty document.
Method Detail

getNamespaceURI

public java.lang.String getNamespaceURI()
Description copied from interface: Node
The namespace URI of this node, or null if it is unspecified.
This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other than 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.
Overrides:
getNamespaceURI in class XMLElement
Returns:
the namespace URI of this element
Since:
DOM 2 Gets the name space URI of this element

getLocalName

public java.lang.String getLocalName()
Gets the local Name for this element.
Overrides:
getLocalName in class XMLElement
Returns:
the local Name

getAttributes

public NamedNodeMap getAttributes()
Description copied from interface: Node
A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
Overrides:
getAttributes in class XMLElement
Returns:
always null

getDoctype

public DocumentType getDoctype()
The Document Type Declaration (DTD) associated with this document. For XML documents without a DTD, this returns null. Note that the DOM Level 1 specification does not support editing the DTD.
Specified by:
getDoctype in interface Document
Returns:
The associated DTD
See Also:
DocumentType

getNodeType

public short getNodeType()
Gets a code representing the type of the underlying object
Overrides:
getNodeType in class XMLElement
Returns:
type of the node

getImplementation

public DOMImplementation getImplementation()
The DOMImplementation object that handles this document. A DOM application may use objects from multiple implementations.
Specified by:
getImplementation in interface Document
Returns:
The associated DOM implementation.

getDocumentElement

public Element getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the root element of the document.
Specified by:
getDocumentElement in interface Document
Returns:
The root element

getOwnerDocument

public Document getOwnerDocument()
The Document object associated with this node. Since this node is a Document this is null.
Overrides:
getOwnerDocument in class XMLNode
Returns:
null

setNodeContext

public void setNodeContext(oracle.xml.util.NodeContext nctx)

createElement

public Element createElement(java.lang.String tagName)
                      throws DOMException
Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.
Specified by:
createElement in interface Document
Parameters:
tagName - The name of the element type to instantiate. The name is treated as case-sensitive.
Returns:
A new Element object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createDocumentFragment

public DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment object.
Specified by:
createDocumentFragment in interface Document
Returns:
A new DocumentFragment.

createTextNode

public Text createTextNode(java.lang.String data)
Creates a Text node given the specified string.
Specified by:
createTextNode in interface Document
Parameters:
data - The data for the node.
Returns:
The new Text object.

createComment

public Comment createComment(java.lang.String data)
Creates a Comment node given the specified string.
Specified by:
createComment in interface Document
Parameters:
data - The data for the node.
Returns:
The new Comment object.

createCDATASection

public CDATASection createCDATASection(java.lang.String data)
                                throws DOMException
Creates a CDATASection node whose value is the specified string.
Specified by:
createCDATASection in interface Document
Parameters:
data - The data for the CDATASection contents.
Returns:
The new CDATASection object.
Throws:
DOMException - A DOMException could be thrown.

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(java.lang.String target,
                                                         java.lang.String data)
                                                  throws DOMException
Creates a ProcessingInstruction node given the specified name and data strings.
Specified by:
createProcessingInstruction in interface Document
Parameters:
target - The target part of the processing instruction.
data - The data for the node.
Returns:
The new ProcessingInstruction object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if an invalid character is specified.

createAttribute

public Attr createAttribute(java.lang.String name)
                     throws DOMException
Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttribute method.
Specified by:
createAttribute in interface Document
Parameters:
name - The name of the attribute.
Returns:
A new Attr object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createEntityReference

public EntityReference createEntityReference(java.lang.String name)
                                      throws DOMException
Creates an EntityReference object.
Specified by:
createEntityReference in interface Document
Parameters:
name - The name of the entity to reference.
Returns:
The new EntityReference object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

getElementsByTagName

public NodeList getElementsByTagName(java.lang.String tagname)
Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree.
Specified by:
getElementsByTagName in interface Document
Overrides:
getElementsByTagName in class XMLElement
Parameters:
tagname - The name of the tag to match on. The special value "*" matches all tags.
Returns:
A new NodeList object containing all the matched Elements.

appendChild

public Node appendChild(Node elem)
                 throws DOMException
Appends a new node to the document
Overrides:
appendChild in class XMLNSNode
Parameters:
the - new node to be added
Returns:
the node after appending it to the document
Throws:
DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the elem node.
WRONG_DOCUMENT_ERR: Raised if elem was created from a different document than this one.

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If the newChild is already in the tree, it is first removed. This is an override of the XMLNode.removeChild method
Overrides:
replaceChild in class XMLNSNode
Parameters:
newChild - The new node to put in the child list.
oldChild - The node being replaced in the list.
Returns:
The node replaced.
Throws:
DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than this one.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.

removeChild

public Node removeChild(Node elem)
                 throws DOMException
removes the elem from this documents list of child nodes
Overrides:
removeChild in class XMLNSNode
Parameters:
the - node to be removed
Returns:
the node after its removed from the document
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this document is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children.
If 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.
Overrides:
insertBefore in class XMLNSNode
Parameters:
newChild - The node to insert.
refChild - The reference node, i.e., the node before which the new node must be inserted.
Returns:
The node being inserted.
Throws:
DOMException - HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.

cloneNode

public Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode returns null.).
Cloning an 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 any other type of node simply returns a copy of this node.
Overrides:
cloneNode in class XMLElement
Parameters:
deep - If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
Returns:
The duplicate node.

setParsedDoctype

public void setParsedDoctype(java.lang.String rootname,
                             java.lang.String sysid,
                             java.lang.String pubid)
                      throws DOMException
Sets the doctype object by parsing sysid
Parameters:
root - The name of the root element
sysid - The system id of the doctype
pubid - The public id of the doctype (can be null)

setDoctype

public void setDoctype(java.lang.String rootname,
                       java.lang.String sysid,
                       java.lang.String pubid)
Sets the doctype URI for the document
Parameters:
root - The name of the root element
sysid - The system id of the doctype
pubid - The public id of the doctype (can be null)

addID

public void addID(java.lang.String name,
                  XMLElement e)
Add a ID Element associated with this document
Parameters:
id - String - id value
e - XMLElement associated with id

getIDElement

public XMLElement getIDElement(java.lang.String idValue)
Deprecated. As of DOM 2

Parameters:
idvalue -  
Returns:
XMLElement associated with idvalue
See Also:
Get the element in the XML DOM Tree with a given ID

getIDHashtable

public java.util.Hashtable getIDHashtable()
Get the ID element hashtable in the XML DOM Tree
Returns:
Hashtable - associated with XMLDocument

getText

public java.lang.String getText()
Returns the non-marked-up text contained by this element. For text elements, this is the raw data. For elements with child nodes, this method traverses the entire subtree and appends the text for each terminal text element, effectively stripping out the XML markup for the subtree. For example, if the XML document contains the following: <AUTHOR> <FIRST>William</FIRST> <LAST>Shakespeare</LAST> </AUTHOR>

XMLDocument.getText returns "William Shakespeare".

Overrides:
getText in class XMLNSNode
Returns:
non-marked-up text contained bu this element

print

public void print(java.io.PrintWriter out)
           throws java.io.IOException
Writes the contents of this document to the given output stream.
Overrides:
print in class XMLNode
Parameters:
out - PrintWriter to write to
Throws:
java.io.IOException - if an error occurs

print

public void print(java.io.OutputStream out)
           throws java.io.IOException
Writes the contents of this document to the given output stream.
Overrides:
print in class XMLNode
Parameters:
out - OutputStream to write to
Throws:
java.io.IOException - if an error occurs

print

public void print(java.io.OutputStream out,
                  java.lang.String enc)
           throws java.io.IOException
Writes the contents of this document to the given output stream.
Overrides:
print in class XMLNode
Parameters:
out - OutputStream to write to
enc - Encoding to use for the output
Throws:
java.io.IOException - if an invalid encoding was specified or if any other error occurs

print

public void print(PrintDriver pd)
           throws java.io.IOException
Writes the contents of this document to the given output stream.
Parameters:
pd - PrintDriver used to write each node
Throws:
java.io.IOException - if an error occurs

printExternalDTD

public void printExternalDTD(java.io.PrintWriter out)
                      throws java.io.IOException
Writes the contents of this document to the given output stream.
Parameters:
out - PrintWriter to write to
Throws:
java.io.IOException - if an error occurs

printExternalDTD

public void printExternalDTD(java.io.OutputStream out)
                      throws java.io.IOException
Writes the contents of this document to the given output stream.
Parameters:
out - OutputStream to write to
Throws:
java.io.IOException - if an error occurs

printExternalDTD

public void printExternalDTD(java.io.OutputStream out,
                             java.lang.String enc)
                      throws java.io.IOException
Writes the contents of the external DTD to the given output stream.
Parameters:
out - OutputStream to write to
enc - Encoding to use for the output
Throws:
java.io.IOException - if an invalid encoding was specified or if any other error occurs

reportSAXEvents

public void reportSAXEvents(ContentHandler cntHandler)
                     throws SAXException
Report SAX Events from a DOM Tree
Overrides:
reportSAXEvents in class XMLElement
Parameters:
ContentHandler - cntHandler
Throws:
SAXException - thrown by SAX Callback functions

validateElementContent

public boolean validateElementContent(Element e)
Validates the content of a element node.
Parameters:
e - Element to be validated
Returns:
True if valid, else false

setLocale

public final void setLocale(java.util.Locale locale)
Sets the locale for error reporting
Parameters:
locale - Locale for error reporting.

expectedElements

public java.util.Vector expectedElements(Element e)
Returns vector of element names that can be appended to the element.
Parameters:
e - Element
Returns:
Vector of names

getVersion

public final java.lang.String getVersion()
Retrieves the version information.
Returns:
the version number stored in the <?xml ...?> tag.

setVersion

public final void setVersion(java.lang.String version)
Sets the version number stored in the <?xml ...?> tag.
Parameters:
version - The version information to set.

getEncoding

public final java.lang.String getEncoding()
Retrieves the character encoding information.
Returns:
the encoding information stored in the <?xml ...?> tag or the user-defined output encoding if it has been more recently set.

setEncoding

public final void setEncoding(java.lang.String encoding)
Sets the character encoding for output. Eventually it sets the ENCODING stored in the <?xml ...?> tag, but not until the document is saved. You should not call this method until the Document has been loaded.
Parameters:
encoding - The character encoding to set

getStandalone

public final java.lang.String getStandalone()
Retrieves the standalone information.
Returns:
the standalone attribute stored in the <?xml ...?> tag.

setStandalone

public final void setStandalone(java.lang.String value)
Sets the standalone information stored in the <?xml ...?> tag.
Parameters:
value - The attribute value ('yes' or 'no').

getDebugMode

public boolean getDebugMode()
Get the debug flag
Overrides:
getDebugMode in class XMLNode
Returns:
boolean flag

getLineNumber

public int getLineNumber()
Get line number debug information
Overrides:
getLineNumber in class XMLNode
Returns:
line the line number

getColumnNumber

public int getColumnNumber()
Get column number debug information
Overrides:
getColumnNumber in class XMLNode
Returns:
column the column number

getSystemId

public java.lang.String getSystemId()
Get the system id of the entity contain this node
Overrides:
getSystemId in class XMLNode
Returns:
sysid the system id

adoptNode

public Node adoptNode(Node srcNode)
               throws DOMException
Parameters:
Node - to be adopted
Returns:
Node with document association updated
Throws:
DOMException - NOT_SUPPORTED_ERR: Raised if the type of the node being adopted is not supported.
Since:
DOM 2 Adopts a node from another document to this document. The returned node has no parent; (parentNode is null). The source node is removed from the original document;

importNode

public Node importNode(Node importedNode,
                       boolean deep)
                throws DOMException
Description copied from interface: Document
Imports a node from another document to this document. The returned node has no parent; (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.
For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's 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.
Additional information is copied as appropriate to the 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.
ATTRIBUTE_NODE
The 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.
DOCUMENT_FRAGMENT_NODE
If the 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_NODE
Document nodes cannot be imported.
DOCUMENT_TYPE_NODE
DocumentType nodes cannot be imported.
ELEMENT_NODE
Specified attribute nodes of the source element are imported, and the generated 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_NODE
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.
ENTITY_REFERENCE_NODE
Only the 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_NODE
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.
PROCESSING_INSTRUCTION_NODE
The imported node copies its target and data values from those of the source node.
TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE
These three types of nodes inheriting from CharacterData copy their data and length attributes from those of the source node.
Specified by:
importNode in interface Document
Parameters:
Node - to be imported ,boolean variable indicating whether the descendants of this node are to be imported
Returns:
A copy of the importedNode which is attached to the current document but not a part of the document tree
Throws:
DOMException - NOT_SUPPORTED_ERR: Raised if the type of the node being imported is not supported.
Since:
DOM 2 imports a node from another document to this document. The returned node has no parent; (parentNode is null). The source nodeis not altered or removed from the original document; this method creates a new copy of the source node.For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's 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.

createElementNS

public Element createElementNS(java.lang.String namespaceURI,
                               java.lang.String qualifiedName)
                        throws DOMException
Description copied from interface: Document
Creates an element of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.
Specified by:
createElementNS in interface Document
Parameters:
String - namespace URI , String qualified name for the element to be created
Returns:
Element node with given qualified name and namespace URI
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains illegal Characters NAMESPACE_ERR : Raised if the qualified name is malformed, if the qualified name has a prefix and the namespace URI is null or an empty string,or if the qulaifiedName has a prefix that is "xml" and namespace URI is different from "http://www.w3.org/XML/1998/namespace"
Since:
DOM 2 Creates an element of the given qualified name and namespace URI.

createAttributeNS

public Attr createAttributeNS(java.lang.String namespaceURI,
                              java.lang.String qualifiedName)
                       throws DOMException
Description copied from interface: Document
Creates an attribute of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.
Specified by:
createAttributeNS in interface Document
Parameters:
String - namespace URI , String qualified name for the attribute to be created
Returns:
Element node with given qualified name and namespace URI
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains illegal Characters NAMESPACE_ERR : Raised if the qualified name is malformed, if the qualified name has a prefix and the namespace URI is null or an empty string,or if the qulaifiedName has a prefix that is "xml" and namespace URI is different from "http://www.w3.org/2000/xmlns/"
Since:
DOM 2 Creates an attribute with the given qualified name and namespace URI.

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Description copied from interface: Document
Returns a 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.
Specified by:
getElementsByTagNameNS in interface Document
Overrides:
getElementsByTagNameNS in class XMLElement
Parameters:
String - namespaceURI,String localName that should match for the returned elements
Returns:
nodelist of matching elements
Since:
DOM 2 Returns a 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.

getElementById

public Element getElementById(java.lang.String elementId)
Description copied from interface: Document
Returns the 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.
Specified by:
getElementById in interface Document
Parameters:
String - elementId used to get the matching Id Element
Returns:
The matching Id Element if one exists or null if none exists
Since:
DOM 2 Returns the 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.

createNodeIterator

public NodeIterator createNodeIterator(Node root,
                                       int whatToShow,
                                       NodeFilter filter,
                                       boolean expandEntityReferences)
                                throws DOMException
Creates a Node Iterator with specified root,flag which governs what type of nodes it should include in logical view, filter for filtering nodes, flag determining whether entity references and its descendants could be included
Specified by:
createNodeIterator in interface DocumentTraversal
Parameters:
Node - root ,int whatToShow, NodeFilter filter,boolean expandEntityReferences
Returns:
object that implements NodeIterator interface,created on this document
Throws:
DOMException - NOT_SUPPORTED_ERR: if the NodeIterator could not be created with specified root

createTreeWalker

public TreeWalker createTreeWalker(Node root,
                                   int whatToShow,
                                   NodeFilter filter,
                                   boolean expandEntityReferences)
                            throws DOMException
Creates a Node Iterator with specified root,flag which governs what type of nodes it should include in logical view, filter for filtering nodes, flag determining whether entity references and its descendants could be included
Specified by:
createTreeWalker in interface DocumentTraversal
Parameters:
Node - root ,int whatToShow, NodeFilter filter,boolean expandEntityReferences
Returns:
an object that implements TreeWalker interface,created on this document
Throws:
DOMException - NOT_SUPPORTED_ERR: if the NodeIterator could not be created with specified root

createRange

public Range createRange()
Create a new Document Range Object ,with Start and End Boundary points at the begining of the document.
Returns:
new Range object with start and end boundary points at the begining of the document

createEvent

public Event createEvent(java.lang.String type)
Creates an event object of the specified type
Parameters:
String - type the type of the event
Returns:
Event object of the specified type

createMutationEvent

public MutationEvent createMutationEvent(java.lang.String type)

createRangeEvent

public Event createRangeEvent(java.lang.String type)

createTraversalEvent

public Event createTraversalEvent(java.lang.String type)

writeExternal

public void writeExternal(java.io.ObjectOutput outArg)
                   throws java.io.IOException
This method saves the state of the object by creating a binray compressed stream with information about this object.
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class XMLElement
Parameters:
out - The ObjectOutput stream used to write the serialized/ compressed stream.
Throws:
java.io.IOException - is thrown when there is an exception while writing the serialized/compressed stream.

writeExternal

public void writeExternal(oracle.xml.io.XMLObjectOutput out,
                          oracle.xml.comp.CXMLContext cxmlContext)
                   throws java.io.IOException
This method saves the state of the object by writing the object information in a binary compressed stream.
Overrides:
writeExternal in class XMLElement
Parameters:
out - The ObjectOutput stream used to write the serialized/ comressed stream.
cxmlContext - The context of the output compressed stream
Throws:
java.io.IOException - is thrown when there is an exception while writing the compressed stream.

readExternal

public void readExternal(java.io.ObjectInput inArg)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class XMLElement
Parameters:
in - the ObjectInput stream used for reading the compressed stream
Throws:
java.io.IOException - is thrown when there is an error in reading the input stream.
java.lang.ClassNotFoundException - is thrown when the class is not found

readExternal

public void readExternal(oracle.xml.io.XMLObjectInput in,
                         oracle.xml.comp.CXMLContext cxmlContext)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Description copied from class: XMLElement
This method restores the information written by writeExternal by reading the input stream and regenerating the objects as per the information of the input stream.
Overrides:
readExternal in class XMLElement
Tags copied from class: XMLElement
Parameters:
in - is the XMLObjectInput stream used to read the compressed stream
Throws:
java.io.IOException - is thrown when there is an exception reading the compressed stream.
java.lang.ClassNotFoundException - is thrown when the class is not found