com.hp.hpl.thermopylae
Class TextImpl

java.lang.Object
  |
  +--com.hp.hpl.thermopylae.NodeImpl
        |
        +--com.hp.hpl.thermopylae.TextImpl
All Implemented Interfaces:
org.w3c.dom.CDATASection, org.w3c.dom.CharacterData, org.w3c.dom.Node, org.w3c.dom.Text

public class TextImpl
extends NodeImpl
implements org.w3c.dom.Text, org.w3c.dom.CDATASection

Standard wrapper around spartan Text node.

Copyright (C) 2002 Hewlett-Packard Company. This file is part of Sparta, an XML Parser, DOM, and XPath library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Version:
$Date: 2002/08/21 20:19:10 $ $Revision: 1.2 $
Author:
Eamonn O'Brien-Strain

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, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node parm1)
          Adds the node newChild to the end of the list of children of this node.
 void appendData(java.lang.String parm1)
          Append the string to the end of the character data of the node.
 org.w3c.dom.Node cloneNode(boolean parm1)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 void deleteData(int parm1, int parm2)
          Remove a range of 16-bit units from the node.
 org.w3c.dom.NamedNodeMap getAttributes()
          A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
 org.w3c.dom.NodeList getChildNodes()
          A NodeList that contains all children of this node.
 java.lang.String getData()
          The character data of the node that implements this interface.
 org.w3c.dom.Node getFirstChild()
          The first child of this node.
 boolean getIsWhitespaceInElementContent()
          Returns whether this text node contains whitespace in element content, often abusively called "ignorable whitespace".An implementation can only return true if, one way or another, it has access to the relevant information (e.g., the DTD or schema).
 org.w3c.dom.Node getLastChild()
          The last child of this node.
 int getLength()
          The number of 16-bit units that are available through data and the substringData method below.
 java.lang.String getLocalName()
          Always return null
 java.lang.String getNamespaceURI()
          Always return null
 java.lang.String getNodeName()
          The name of this node, depending on its type; see the table above.
 short getNodeType()
          A code representing the type of the underlying object, as defined above.
 java.lang.String getNodeValue()
          The value of this node, depending on its type; see the table above.
 org.w3c.dom.Node getParentNode()
          The parent of this node.
 java.lang.String getPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 java.lang.String getWholeText()
          Returns all text of Text nodes logically-adjacent text nodes to this node, concatenated in document order.
 boolean hasAttributes()
          Returns whether this node (if it is an element) has any attributes.
 boolean hasChildNodes()
          ALways returns false.
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node parm1, org.w3c.dom.Node parm2)
          Inserts the node newChild before the existing child node refChild.
 void insertData(int parm1, java.lang.String parm2)
          Insert a string at the specified 16-bit unit offset.
 boolean isSupported(java.lang.String feature, java.lang.String version)
          Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
 void normalize()
          Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "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.
 org.w3c.dom.Node removeChild(org.w3c.dom.Node parm1)
          Removes the child node indicated by oldChild from the list of children, and returns it.
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node parm1, org.w3c.dom.Node parm2)
          Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
 void replaceData(int parm1, int parm2, java.lang.String parm3)
          Replace the characters starting at the specified 16-bit unit offset with the specified string.
 org.w3c.dom.Text replaceWholeText(java.lang.String content)
          Substitutes the a specified text for the text of the current node and all logically-adjacent text nodes.
 void setData(java.lang.String parm1)
          The character data of the node that implements this interface.
 void setNodeValue(java.lang.String data)
          The value of this node, depending on its type; see the table above.
 void setPrefix(java.lang.String parm1)
          The namespace prefix of this node, or null if it is unspecified.
 org.w3c.dom.Text splitText(int parm1)
          Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
 java.lang.String substringData(int parm1, int parm2)
          Extracts a range of data from the node.
 
Methods inherited from class com.hp.hpl.thermopylae.NodeImpl
compareTreePosition, equals, getBaseURI, getInterface, getNextSibling, getOwnerDocument, getPreviousSibling, getTextContent, getUserData, isEqualNode, isSameNode, lookupNamespacePrefix, lookupNamespaceURI, setTextContent, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
compareTreePosition, getBaseURI, getInterface, getNextSibling, getOwnerDocument, getPreviousSibling, getTextContent, getUserData, isEqualNode, isSameNode, lookupNamespacePrefix, lookupNamespaceURI, setTextContent, setUserData
 

Method Detail

splitText

public org.w3c.dom.Text splitText(int parm1)
                           throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Text
Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.
Specified by:
splitText in interface org.w3c.dom.Text
Following copied from interface: org.w3c.dom.Text
Parameters:
offset - The 16-bit unit offset at which to split, starting from 0.
Returns:
The new node, of the same type as this node.
Throws:
org.w3c.dom.DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

appendData

public void appendData(java.lang.String parm1)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the DOMString specified.
Specified by:
appendData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Parameters:
arg - The DOMString to append.
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

deleteData

public void deleteData(int parm1,
                       int parm2)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.
Specified by:
deleteData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Parameters:
offset - The offset from which to start removing.
count - The number of 16-bit units to delete. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted.
Throws:
org.w3c.dom.DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

getData

public java.lang.String getData()
                         throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.
When the CharacterData is a Text, or a CDATASection, this attribute contains the property [character code] defined in . When the CharacterData is a Comment, this attribute contains the property [content] defined by the Comment Information Item in .
Specified by:
getData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
org.w3c.dom.DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

getLength

public int getLength()
Description copied from interface: org.w3c.dom.CharacterData
The number of 16-bit units that are available through data and the substringData method below. This may have the value zero, i.e., CharacterData nodes may be empty.
Specified by:
getLength in interface org.w3c.dom.CharacterData

insertData

public void insertData(int parm1,
                       java.lang.String parm2)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Insert a string at the specified 16-bit unit offset.
Specified by:
insertData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Parameters:
offset - The character offset at which to insert.
arg - The DOMString to insert.
Throws:
org.w3c.dom.DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

replaceData

public void replaceData(int parm1,
                        int parm2,
                        java.lang.String parm3)
                 throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Replace the characters starting at the specified 16-bit unit offset with the specified string.
Specified by:
replaceData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Parameters:
offset - The offset from which to start replacing.
count - The number of 16-bit units to replace. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced; (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation).
arg - The DOMString with which the range must be replaced.
Throws:
org.w3c.dom.DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

setData

public void setData(java.lang.String parm1)
             throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.
When the CharacterData is a Text, or a CDATASection, this attribute contains the property [character code] defined in . When the CharacterData is a Comment, this attribute contains the property [content] defined by the Comment Information Item in .
Specified by:
setData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
org.w3c.dom.DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

substringData

public java.lang.String substringData(int parm1,
                                      int parm2)
                               throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Extracts a range of data from the node.
Specified by:
substringData in interface org.w3c.dom.CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Parameters:
offset - Start offset of substring to extract.
count - The number of 16-bit units to extract.
Returns:
The specified substring. If the sum of offset and count exceeds the length, then all 16-bit units to the end of the data are returned.
Throws:
org.w3c.dom.DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into a DOMString.

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node parm1)
                             throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
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 org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Parameters:
newChild - 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:
org.w3c.dom.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 or this node itself.
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 or if the previous parent of the node being inserted is readonly.

cloneNode

public org.w3c.dom.Node cloneNode(boolean parm1)
Description copied from interface: org.w3c.dom.Node
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; ( parentNode is null.) and no user data. User data associated to the imported node is not carried over. However, if any UserDataHandlers has been specified along with the associated data these handlers will be called with the appropriate parameters before this method returns.
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 children it contains unless it is a deep clone. This includes text contained in an the Element since the text is contained in a child Text node. Cloning an Attribute directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute (specified is true). Cloning an Attribute always clones its children, since they represent its value, no matter whether this is a deep clone or not. Cloning an EntityReference automatically constructs its subtree if a corresponding Entity is available, no matter whether this is a deep clone or not. Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are readonly . In addition, clones of unspecified Attr nodes are specified. And, cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent.
Specified by:
cloneNode in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
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.

getAttributes

public org.w3c.dom.NamedNodeMap getAttributes()
Description copied from interface: org.w3c.dom.Node
A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
If no namespace declaration appear in the attributes, this attribute represents the property [attributes] defined in .
Specified by:
getAttributes in interface org.w3c.dom.Node

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Description copied from interface: org.w3c.dom.Node
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
When the node is a Document, or an Element, and if the NodeList does not contain EntityReference or CDATASection nodes, this attribute represents the properties [children] defined in .
Specified by:
getChildNodes in interface org.w3c.dom.Node

getFirstChild

public org.w3c.dom.Node getFirstChild()
Description copied from interface: org.w3c.dom.Node
The first child of this node. If there is no such node, this returns null.
Specified by:
getFirstChild in interface org.w3c.dom.Node

getLastChild

public org.w3c.dom.Node getLastChild()
Description copied from interface: org.w3c.dom.Node
The last child of this node. If there is no such node, this returns null.
Specified by:
getLastChild in interface org.w3c.dom.Node

getLocalName

public java.lang.String getLocalName()
Always return null
Specified by:
getLocalName in interface org.w3c.dom.Node

getNamespaceURI

public java.lang.String getNamespaceURI()
Always return null
Specified by:
getNamespaceURI in interface org.w3c.dom.Node

getNodeName

public java.lang.String getNodeName()
Description copied from interface: org.w3c.dom.Node
The name of this node, depending on its type; see the table above.
Specified by:
getNodeName in interface org.w3c.dom.Node

getNodeType

public short getNodeType()
Description copied from interface: org.w3c.dom.Node
A code representing the type of the underlying object, as defined above.
Specified by:
getNodeType in interface org.w3c.dom.Node

getNodeValue

public java.lang.String getNodeValue()
                              throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.
Specified by:
getNodeValue in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
org.w3c.dom.DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

getParentNode

public org.w3c.dom.Node getParentNode()
Description copied from interface: org.w3c.dom.Node
The parent of this node. All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.
When the node is an Element, a ProcessingInstruction, an EntityReference, a CharacterData, a Comment, or a DocumentType, this attribute represents the properties [parent] defined in .
Specified by:
getParentNode in interface org.w3c.dom.Node

getPrefix

public java.lang.String getPrefix()
Description copied from interface: org.w3c.dom.Node
The namespace prefix of this node, or null if it is unspecified.
When the node is Element, or Attr, this attribute represents the properties [prefix] defined in .
Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change.
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.
Specified by:
getPrefix in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character, per the XML 1.0 specification .
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is null, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from " http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns" .

hasAttributes

public boolean hasAttributes()
Description copied from interface: org.w3c.dom.Node
Returns whether this node (if it is an element) has any attributes.
Specified by:
hasAttributes in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Returns:
true if this node has any attributes, false otherwise.

hasChildNodes

public boolean hasChildNodes()
ALways returns false.
Specified by:
hasChildNodes in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Returns:
true if this node has any children, false otherwise.

insertBefore

public org.w3c.dom.Node insertBefore(org.w3c.dom.Node parm1,
                                     org.w3c.dom.Node parm2)
                              throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
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 org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
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:
org.w3c.dom.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 or this node itself, or if this node if of type Document and the DOM application attempts to insert a second DocumentType or Element node.
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 or if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node if of type Document, this exception might be raised if the DOM implementation doesn't support the insertion of a DocumentType or Element node.

isSupported

public boolean isSupported(java.lang.String feature,
                           java.lang.String version)
Description copied from interface: org.w3c.dom.Node
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
Specified by:
isSupported in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Parameters:
feature - The name of the feature to test. This is the same name which can be passed to the method hasFeature on DOMImplementation.
version - This is the version number of the feature to test. In Level 2, version 1, this is the string "2.0". If the version is not specified, supporting any version of the feature will cause the method to return true.
Returns:
Returns true if the specified feature is supported on this node, false otherwise.

normalize

public void normalize()
Description copied from interface: org.w3c.dom.Node
Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "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.In cases where the document contains CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate between Text nodes and CDATASection nodes.
Specified by:
normalize in interface org.w3c.dom.Node

removeChild

public org.w3c.dom.Node removeChild(org.w3c.dom.Node parm1)
                             throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
Removes the child node indicated by oldChild from the list of children, and returns it.
Specified by:
removeChild in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Parameters:
oldChild - The node being removed.
Returns:
The node removed.
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node if of type Document, this exception might be raised if the DOM implementation doesn't support the removal of the DocumentType child or the Element child.

replaceChild

public org.w3c.dom.Node replaceChild(org.w3c.dom.Node parm1,
                                     org.w3c.dom.Node parm2)
                              throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.
Specified by:
replaceChild in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Parameters:
newChild - The new node to put in the child list.
oldChild - The node being replaced in the list.
Returns:
The node replaced.
Throws:
org.w3c.dom.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 put in is one of this node's ancestors or this node itself.
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 or the parent of the new node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node if of type Document, this exception might be raised if the DOM implementation doesn't support the replacement of the DocumentType child or Element child.

setNodeValue

public void setNodeValue(java.lang.String data)
                  throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.
Specified by:
setNodeValue in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
org.w3c.dom.DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

setPrefix

public void setPrefix(java.lang.String parm1)
               throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Node
The namespace prefix of this node, or null if it is unspecified.
When the node is Element, or Attr, this attribute represents the properties [prefix] defined in .
Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change.
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.
Specified by:
setPrefix in interface org.w3c.dom.Node
Following copied from interface: org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character, per the XML 1.0 specification .
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is null, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from " http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns" .

getIsWhitespaceInElementContent

public boolean getIsWhitespaceInElementContent()
Description copied from interface: org.w3c.dom.Text
Returns whether this text node contains whitespace in element content, often abusively called "ignorable whitespace".An implementation can only return true if, one way or another, it has access to the relevant information (e.g., the DTD or schema).
This attribute represents the property [element content whitespace] defined in .
Specified by:
getIsWhitespaceInElementContent in interface org.w3c.dom.Text

getWholeText

public java.lang.String getWholeText()
Description copied from interface: org.w3c.dom.Text
Returns all text of Text nodes logically-adjacent text nodes to this node, concatenated in document order.
Specified by:
getWholeText in interface org.w3c.dom.Text

replaceWholeText

public org.w3c.dom.Text replaceWholeText(java.lang.String content)
                                  throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.Text
Substitutes the a specified text for the text of the current node and all logically-adjacent text nodes.
This method returns the node in the hierarchy which received the replacement text, which is null if the text was empty or is the current node if the current node is not read-only or otherwise is a new node of the same type as the current node inserted at the site of the replacement. All logically-adjacent text nodes are removed including the current node unless it was the recipient of the replacement text.
Where the nodes to be removed are read-only descendants of an EntityReference, the EntityReference must be removed instead of the read-only nodes. If any EntityReference to be removed has descendants that are not EntityReference, Text, or CDATASection nodes, the replaceWholeText method must fail before performing any modification of the document, raising a DOMException with the code NO_MODIFICATION_ALLOWED_ERR.
Specified by:
replaceWholeText in interface org.w3c.dom.Text
Following copied from interface: org.w3c.dom.Text
Parameters:
content - The content of the replacing Text node.
Returns:
The Text node created with the specified content.
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if one of the Text nodes being replaced is readonly.