Oracle® Application Server
XML Java API Reference
10g Release 3 (10.1.3)

B28238-01


oracle.xml.parser.v2
Class XMLNSNode

java.lang.Object
  extended byoracle.xml.parser.v2.XMLNode
      extended byoracle.xml.parser.v2.XMLNSNode

All Implemented Interfaces:
java.lang.Cloneable, EventTarget, java.io.Externalizable, Node, NodeEditVAL, java.io.Serializable
Direct Known Subclasses:
XMLAttr, XMLElement, XMLEntity, XMLEntityReference

public class XMLNSNode
extends XMLNode

Extends XMLNode to add support for Namespace names and children

See Also:
Serialized Form

Field Summary

Fields inherited from class oracle.xml.parser.v2.XMLNode
ATTRDECL, Auto_Events, capturing, DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMSubtreeModified, ELEMENTDECL, NAMESPACE_NODE, 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, XDB_DATA, XMLDECL_NODE

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

Fields inherited from interface org.w3c.dom.validation.NodeEditVAL
VAL_FALSE, VAL_INCOMPLETE, VAL_NS_WF, VAL_SCHEMA, VAL_TRUE, VAL_UNKNOWN, VAL_WF

Method Summary
void addText(char[] ch, int start, int length)
Adds text to this node, or appends str to the last child if the last child is a text node.
XMLNode addText(java.lang.String str)
Adds text to this node, or appends str to the last child if the last child is a text node.
Node appendChild(Node newChildArg)
Adds the node newChild to the end of the list of children of this node.
NodeList getChildNodes()
Gets a NodeList that contains all children of this node.
Node getFirstChild()
Gets the first child of this node.
Node getLastChild()
Gets the last child of this node.
java.lang.String getText()
Returns the non-marked-up text contained by this element.
Node insertBefore(Node newChildArg, Node refChildArg)
Inserts the node newChild before the existing child node refChild.
void normalize()
Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes,i.e., there are neither adjacent Text nodes nor empty Text nodes.
Node removeChild(Node oldChildArg)
Removes the child node indicated by oldChildArg from the list of children, and returns it.
Node replaceChild(Node newChildArg, Node oldChildArg)
Replaces the child node oldChildArg with newChildArg in the list of children, and returns the oldChildArg node.

Methods inherited from class oracle.xml.parser.v2.XMLNode
addEventListener, canAppendChild, canInsertBefore, canRemoveChild, canReplaceChild, cloneNode, dispatchEvent, equals, getAttributes, getColumnNumber, getDebugMode, getDefaultValue, getEnumeratedValues, getLineNumber, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getPrimitiveTypeId, getProperty, getQName, getSchemaTypeName, getSystemId, getXMLError, hasAttributes, hasChildNodes, hashCode, isDocumentFlag, isNodeFlag, isSupported, nodeValidity, print, print, print, print, readExternal, removeEventListener, reportSAXEvents, resetNodeFlag, selectNodes, selectNodes, selectSingleNode, selectSingleNode, setDebugInfo, setNodeFlag, setNodeFlag, setNodeFlag, setNodeValue, setPrefix, setProperty, transformNode, valueOf, valueOf, writeExternal, xdbGetNodeId

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Method Detail

getChildNodes

public NodeList getChildNodes()
Gets a NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes. The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. This is true for every NodeList, including the ones returned by the getElementsByTagName method.
Specified by:
getChildNodes in interface Node
Overrides:
getChildNodes in class XMLNode
Returns:
The children of this node

getFirstChild

public Node getFirstChild()
Gets the first child of this node. If there is no such node, this returns null.
Specified by:
getFirstChild in interface Node
Overrides:
getFirstChild in class XMLNode
Returns:
The first child of this node

getLastChild

public Node getLastChild()
Gets the last child of this node. If there is no such node, this returns null.
Specified by:
getLastChild in interface Node
Overrides:
getLastChild in class XMLNode
Returns:
The last child of this node

appendChild

public Node appendChild(Node newChildArg)
                 throws DOMException
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.
Specified by:
appendChild in interface Node
Overrides:
appendChild in class XMLNode
Parameters:
newChildArg - The node to add. If it is a DocumentFragment object, the entire contents of the document fragment are moved into the child list of this node
Returns:
The node added.
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 append 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.

removeChild

public Node removeChild(Node oldChildArg)
                 throws DOMException
Removes the child node indicated by oldChildArg from the list of children, and returns it.
Specified by:
removeChild in interface Node
Overrides:
removeChild in class XMLNode
Parameters:
oldChildArg - The node being removed.
Returns:
The node removed.
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldChildArg is not a child of this node.

insertBefore

public Node insertBefore(Node newChildArg,
                         Node refChildArg)
                  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.
Specified by:
insertBefore in interface Node
Overrides:
insertBefore in class XMLNode
Parameters:
newChildArg - The node to insert.
refChildArg - 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.

replaceChild

public Node replaceChild(Node newChildArg,
                         Node oldChildArg)
                  throws DOMException
Replaces the child node oldChildArg with newChildArg in the list of children, and returns the oldChildArg node. If the newChildArg is already in the tree, it is first removed.
Specified by:
replaceChild in interface Node
Overrides:
replaceChild in class XMLNode
Parameters:
newChildArg - The new node to put in the child list.
oldChildArg - 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 newChildArg node, or it the node to put in is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if newChildArg 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 oldChildArg is not a child of this node.

normalize

public void normalize()
Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes,i.e., there are neither adjacent Text nodes nor empty Text nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used. DOM 3.0 optional feature - this method does not support the parameter "normalize-characters=true" of the DOMConfiguration object, attached to the Node.ownerDocument.
Specified by:
normalize in interface Node
Overrides:
normalize in class XMLNode
Since:
DOM 2

addText

public XMLNode addText(java.lang.String str)
                throws XMLDOMException
Adds text to this node, or appends str to the last child if the last child is a text node.
Parameters:
str - text to add
Throws:
XMLDOMException - if text can't be added to this node

addText

public void addText(char[] ch,
                    int start,
                    int length)
             throws XMLDOMException
Adds text to this node, or appends str to the last child if the last child is a text node.
Overrides:
addText in class XMLNode
Parameters:
ch - char array to add
start - start index in the char array
length - no of chars to be added
Throws:
XMLDOMException - if text can't be added to this node

getText

public java.lang.String getText()
Returns the non-marked-up text contained by this element. For text elements, this is the raw 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: <xmp> <AUTHOR> <FIRST>William</FIRST> <LAST>Shakespeare</LAST> </AUTHOR> </xmp>

XMLDocument.getText returns "William Shakespeare".

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

Oracle® Application Server
XML Java API Reference
10g Release 3 (10.1.3)

B28238-01


Copyright © 2003, 2006, Oracle. All rights reserved.