Package com.icl.saxon.tree
Class ElementWithAttributes
- java.lang.Object
-
- com.icl.saxon.om.AbstractNode
-
- com.icl.saxon.tree.NodeImpl
-
- com.icl.saxon.tree.ElementImpl
-
- com.icl.saxon.tree.ElementWithAttributes
-
- All Implemented Interfaces:
NodeInfo
,DOMLocator
,Source
,SourceLocator
,Element
,NamedNodeMap
,Node
- Direct Known Subclasses:
StyleElement
public class ElementWithAttributes extends ElementImpl implements Element, NamedNodeMap
A node in the XML parse tree representing an XML element.This class is an implementation of NodeInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributeCollection
attributeList
protected int[]
namespaceList
protected int
sequence
-
Fields inherited from class com.icl.saxon.tree.ElementImpl
nameCode, root
-
Fields inherited from class com.icl.saxon.tree.NodeImpl
emptyArray, index, parent
-
Fields inherited from class com.icl.saxon.om.AbstractNode
NODE_LETTER
-
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
-
Constructor Summary
Constructors Constructor Description ElementWithAttributes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(NodeImpl node, int index)
Add a child node to this node.void
addNamespaceNodes(ElementImpl owner, Vector list, boolean addXML)
Make the set of all namespace nodes associated with this element.void
compact(int size)
Compact the space used by this nodevoid
copy(Outputter out, boolean allNamespaces)
Copy this node to a given outputter (supporting xsl:copy-of)void
copyStringValue(Outputter out)
Copy the string-value of this node to a given outputtervoid
dropChildren()
Drop a branch of the tree.AxisEnumeration
enumerateChildren(NodeTest test)
Get an enumeration of the children of this nodeString
getAttribute(String name)
Retrieves an attribute value by name.AttributeCollection
getAttributeList()
Get the attribute list for this element.Attr
getAttributeNode(String name)
Retrieves an attribute node by name.Attr
getAttributeNodeNS(String namespaceURI, String localName)
Retrieves anAttr
node by local name and namespace URI.String
getAttributeNS(String namespaceURI, String localName)
Retrieves an attribute value by local name and namespace URI.NamedNodeMap
getAttributes()
ANamedNodeMap
containing the attributes of this element.String
getAttributeValue(int fingerprint)
Get the value of a given attribute of this nodeString
getAttributeValue(String name)
Find the value of a given attribute of this element.String
getAttributeValue(String uri, String localName)
Find the value of a given attribute of this node.NodeList
getChildNodes()
Return aNodeList
that contains all children of this node.Node
getFirstChild()
Get the first child node of the elementNode
getLastChild()
Get the last child node of the elementint
getLength()
Get number of attributes (DOM NamedNodeMap method).Node
getNamedItem(String name)
Get named attribute (DOM NamedNodeMap method) Treats namespace declarations as attributes.Node
getNamedItemNS(String uri, String localName)
Get named attribute (DOM NamedNodeMap method) Treats namespace declarations as attributes.protected int[]
getNamespaceCodes()
Get the list of in-scope namespaces for this element as an array of namespace codes.String
getNodeValue()
Get the node value as defined in the DOM.protected NodeImpl
getNthChild(int n)
Get the nth child node of the element (numbering from 0)String
getPrefixForURI(String uri)
Search the NamespaceList for a given URI, returning the corresponding prefix.protected long
getSequenceNumber()
Get the node sequence number (in document order).String
getStringValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.short
getURICodeForPrefix(String prefix)
Search the NamespaceList for a given prefix, returning the corresponding URI.boolean
hasAttribute(String name)
Returnstrue
when an attribute with a given name is specified on this element or has a default value,false
otherwise.boolean
hasAttributeNS(String namespaceURI, String localName)
Returnstrue
when an attribute with a given local name and namespace URI is specified on this element or has a default value,false
otherwise.boolean
hasAttributes()
Returns whether this node (if it is an element) has any attributes.boolean
hasChildNodes()
Determine if the node has any children.void
initialise(int nameCode, AttributeCollection atts, NodeInfo parent, String baseURI, int lineNumber, int sequenceNumber)
Initialise a new ElementWithAttributes with an element name and attribute listNode
item(int index)
Get n'th attribute (DOM NamedNodeMap method).void
outputNamespaceNodes(Outputter out, boolean includeAncestors)
Output all namespace nodes associated with this element.void
removeAttribute(String name)
Removes an attribute by name.Attr
removeAttributeNode(Attr oldAttr)
Removes the specified attribute node.void
removeAttributeNS(String namespaceURI, String localName)
Removes an attribute by local name and namespace URI.void
removeChild(int index)
Remove node at given index.Node
removeNamedItem(String name)
Remove named attribute (DOM NamedNodeMap method: always fails)Node
removeNamedItemNS(String uri, String localName)
Remove named attribute (DOM NamedNodeMap method: always fails)void
renumberChildren()
Renumber the children of a given parent node.void
setAttribute(String name, String value)
Set the value of an attribute on the current element.Attr
setAttributeNode(Attr newAttr)
Adds a new attribute node.Attr
setAttributeNodeNS(Attr newAttr)
Add a new attribute.void
setAttributeNS(String namespaceURI, String qualifiedName, String value)
Adds a new attribute.Node
setNamedItem(Node arg)
Set named attribute (DOM NamedNodeMap method: always fails)Node
setNamedItemNS(Node arg)
Set named attribute (DOM NamedNodeMap method: always fails)void
setNamespaceDeclarations(int[] namespaces, int namespacesUsed)
Set the namespace declarations for the elementvoid
useChildrenArray(NodeImpl[] array)
Supply an array to be used for the array of children.-
Methods inherited from class com.icl.saxon.tree.ElementImpl
copy, generateId, getBaseURI, getDocumentRoot, getLineNumber, getNameCode, getNodeType, getSystemId, makeNameCode, setLineNumber, setNameCode, setSystemId
-
Methods inherited from class com.icl.saxon.tree.NodeImpl
compareOrder, getDisplayName, getDocumentElement, getEnumeration, getFingerprint, getLocalName, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getURI, isSameNodeInfo, removeNode
-
Methods inherited from class com.icl.saxon.om.AbstractNode
appendChild, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getColumnNumber, getData, getDoctype, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getName, getNamespaceURI, getNodeName, getOwnerDocument, getOwnerElement, getParentNode, getPublicId, getSchemaTypeInfo, getSpecified, getTagName, getTextContent, getUserData, getValue, getWholeText, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isId, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, replaceData, replaceWholeText, setData, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setUserData, setValue, splitText, substringData, supports
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Element
getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, setIdAttribute, setIdAttributeNode, setIdAttributeNS
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Field Detail
-
attributeList
protected AttributeCollection attributeList
-
namespaceList
protected int[] namespaceList
-
sequence
protected int sequence
-
-
Method Detail
-
initialise
public void initialise(int nameCode, AttributeCollection atts, NodeInfo parent, String baseURI, int lineNumber, int sequenceNumber)
Initialise a new ElementWithAttributes with an element name and attribute list- Overrides:
initialise
in classElementImpl
- Parameters:
name
- The element name, with namespaces resolvedatts
- The attribute list, after namespace processingparent
- The parent node
-
setNamespaceDeclarations
public void setNamespaceDeclarations(int[] namespaces, int namespacesUsed)
Set the namespace declarations for the element
-
getURICodeForPrefix
public short getURICodeForPrefix(String prefix) throws NamespaceException
Search the NamespaceList for a given prefix, returning the corresponding URI.- Overrides:
getURICodeForPrefix
in classElementImpl
- Parameters:
prefix
- The prefix to be matched. To find the default namespace, supply ""- Returns:
- The URI code corresponding to this namespace. If it is an unnamed default namespace, return Namespace.NULL_CODE.
- Throws:
NamespaceException
- if the prefix has not been declared on this NamespaceList.
-
getPrefixForURI
public String getPrefixForURI(String uri)
Search the NamespaceList for a given URI, returning the corresponding prefix.- Overrides:
getPrefixForURI
in classElementImpl
- Parameters:
uri
- The URI to be matched.- Returns:
- The prefix corresponding to this URI. If not found, return null. If there is more than one prefix matching the URI, the first one found is returned. If the URI matches the default namespace, return an empty string.
-
addNamespaceNodes
public void addNamespaceNodes(ElementImpl owner, Vector list, boolean addXML)
Make the set of all namespace nodes associated with this element.- Overrides:
addNamespaceNodes
in classElementImpl
- Parameters:
owner
- The element owning these namespace nodes.list
- a Vector containing NamespaceImpl objects representing the namespaces in scope for this element; the method appends nodes to this Vector, which should initially be empty. Note that the returned list will never contain the XML namespace (to get this, the NamespaceEnumeration class adds it itself). The list WILL include an entry for the undeclaration xmlns=""; again it is the job of NamespaceEnumeration to ignore this, since it doesn't represent a true namespace node.addXML
- Add a namespace node for the XML namespace
-
outputNamespaceNodes
public void outputNamespaceNodes(Outputter out, boolean includeAncestors) throws TransformerException
Output all namespace nodes associated with this element.- Specified by:
outputNamespaceNodes
in interfaceNodeInfo
- Overrides:
outputNamespaceNodes
in classElementImpl
- Parameters:
out
- The relevant outputterincludeAncestors
- True if namespaces declared on ancestor elements must be output; false if it is known that these are already on the result tree- Throws:
TransformerException
-
getNamespaceCodes
protected int[] getNamespaceCodes()
Get the list of in-scope namespaces for this element as an array of namespace codes. (Used by LiteralResultElement)
-
getAttributeList
public AttributeCollection getAttributeList()
Get the attribute list for this element.- Overrides:
getAttributeList
in classElementImpl
- Returns:
- The attribute list. This will not include any namespace attributes. The attribute names will be in expanded form, with prefixes replaced by URIs
-
hasAttributes
public boolean hasAttributes()
Returns whether this node (if it is an element) has any attributes.- Specified by:
hasAttributes
in interfaceNode
- Overrides:
hasAttributes
in classNodeImpl
- Returns:
true
if this node has any attributes,false
otherwise.- Since:
- DOM Level 2
-
getAttributeValue
public String getAttributeValue(String uri, String localName)
Find the value of a given attribute of this node.
This method is defined on all nodes to meet XSL requirements, but for nodes other than elements it will always return null.- Specified by:
getAttributeValue
in interfaceNodeInfo
- Overrides:
getAttributeValue
in classNodeImpl
- Parameters:
uri
- the namespace uri of an attributelocalName
- the local name of an attribute- Returns:
- the value of the attribute, if it exists, otherwise null
-
getAttributeValue
public String getAttributeValue(String name)
Find the value of a given attribute of this element.
This is a short-cut method; the full capability to examine attributes is offered via the getAttributeList() method.
The attribute may either be one that was present in the original XML document, or one that has been set by the application using setAttribute().- Overrides:
getAttributeValue
in classElementImpl
- Parameters:
name
- the name of an attribute. There must be no prefix in the name.- Returns:
- the value of the attribute, if it exists, otherwise null
-
getAttributeValue
public String getAttributeValue(int fingerprint)
Get the value of a given attribute of this node- Specified by:
getAttributeValue
in interfaceNodeInfo
- Overrides:
getAttributeValue
in classNodeImpl
- Parameters:
fingerprint
- The fingerprint of the attribute name- Returns:
- the attribute value if it exists or null if not
-
setAttribute
public void setAttribute(String name, String value) throws DOMException
Set the value of an attribute on the current element. This affects subsequent calls of getAttribute() for that element.- Specified by:
setAttribute
in interfaceElement
- Overrides:
setAttribute
in classElementImpl
- Parameters:
name
- The name of the attribute to be set. Any prefix is interpreted relative to the namespaces defined for this element.value
- The new value of the attribute. Set this to null to remove the attribute.- Throws:
DOMException
- (always): Saxon trees are immutable.
-
copy
public void copy(Outputter out, boolean allNamespaces) throws TransformerException
Copy this node to a given outputter (supporting xsl:copy-of)- Overrides:
copy
in classElementImpl
- Parameters:
out
- The outputterallNamespaces
- true if namespaces for ancestor nodes must be output- Throws:
TransformerException
-
getAttribute
public String getAttribute(String name)
Retrieves an attribute value by name. Namespace declarations are not returned.- Specified by:
getAttribute
in interfaceElement
- Overrides:
getAttribute
in classAbstractNode
- Parameters:
name
- The name of the attribute to retrieve.- Returns:
- The
Attr
value as a string, or the empty string if that attribute does not have a specified or default value. (Note the difference from getAttributeValue(), which returns null if there is no value).
-
getAttributes
public NamedNodeMap getAttributes()
ANamedNodeMap
containing the attributes of this element. This is a DOM method, so the list of attributes includes namespace declarations.- Specified by:
getAttributes
in interfaceNode
- Overrides:
getAttributes
in classNodeImpl
-
removeAttribute
public void removeAttribute(String name)
Removes an attribute by name.- Specified by:
removeAttribute
in interfaceElement
- Overrides:
removeAttribute
in classAbstractNode
- Parameters:
name
- The name of the attribute to remove.
-
getAttributeNode
public Attr getAttributeNode(String name)
Retrieves an attribute node by name. Namespace declarations are not returned.
To retrieve an attribute node by qualified name and namespace URI, use thegetAttributeNodeNS
method.- Specified by:
getAttributeNode
in interfaceElement
- Overrides:
getAttributeNode
in classAbstractNode
- Parameters:
name
- The name (nodeName
) of the attribute to retrieve.- Returns:
- The
Attr
node with the specified name (nodeName
) ornull
if there is no such attribute.
-
setAttributeNode
public Attr setAttributeNode(Attr newAttr) throws DOMException
Adds a new attribute node. Always fails- Specified by:
setAttributeNode
in interfaceElement
- Overrides:
setAttributeNode
in classAbstractNode
- Throws:
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
-
removeAttributeNode
public Attr removeAttributeNode(Attr oldAttr) throws DOMException
Removes the specified attribute node. Always fails- Specified by:
removeAttributeNode
in interfaceElement
- Overrides:
removeAttributeNode
in classAbstractNode
- Throws:
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
-
getAttributeNS
public String getAttributeNS(String namespaceURI, String localName)
Retrieves an attribute value by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.- Specified by:
getAttributeNS
in interfaceElement
- Overrides:
getAttributeNS
in classAbstractNode
- Parameters:
namespaceURI
- The namespace URI of the attribute to retrieve.localName
- The local name of the attribute to retrieve.- Returns:
- The
Attr
value as a string, or the empty string if that attribute does not have a specified or default value. - Since:
- DOM Level 2
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
Adds a new attribute. Always fails.- Specified by:
setAttributeNS
in interfaceElement
- Overrides:
setAttributeNS
in classAbstractNode
- Parameters:
namespaceURI
- The namespace URI of the attribute to create or alter.qualifiedName
- The qualified name of the attribute to create or alter.value
- The value to set in string form.- Throws:
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
-
removeAttributeNS
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
Removes an attribute by local name and namespace URI. Always fails- Specified by:
removeAttributeNS
in interfaceElement
- Overrides:
removeAttributeNS
in classAbstractNode
- Throws:
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.- Since:
- DOM Level 2
-
getAttributeNodeNS
public Attr getAttributeNodeNS(String namespaceURI, String localName)
Retrieves anAttr
node by local name and namespace URI. DOM method, so namespace declarations count as attributes.- Specified by:
getAttributeNodeNS
in interfaceElement
- Overrides:
getAttributeNodeNS
in classAbstractNode
- Parameters:
namespaceURI
- The namespace URI of the attribute to retrieve.localName
- The local name of the attribute to retrieve.- Returns:
- The
Attr
node with the specified attribute local name and namespace URI ornull
if there is no such attribute. - Since:
- DOM Level 2
-
setAttributeNodeNS
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
Add a new attribute. Always fails.- Specified by:
setAttributeNodeNS
in interfaceElement
- Overrides:
setAttributeNodeNS
in classAbstractNode
- Parameters:
newAttr
- TheAttr
node to add to the attribute list.- Returns:
- If the
newAttr
attribute replaces an existing attribute with the same local name and namespace URI , the replacedAttr
node is returned, otherwisenull
is returned. - Throws:
DOMException
-
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.- Since:
- DOM Level 2
-
hasAttribute
public boolean hasAttribute(String name)
Returnstrue
when an attribute with a given name is specified on this element or has a default value,false
otherwise. Namespace declarations are not included.- Specified by:
hasAttribute
in interfaceElement
- Overrides:
hasAttribute
in classAbstractNode
- Parameters:
name
- The name of the attribute to look for.- Returns:
true
if an attribute with the given name is specified on this element or has a default value,false
otherwise.- Since:
- DOM Level 2
-
hasAttributeNS
public boolean hasAttributeNS(String namespaceURI, String localName)
Returnstrue
when an attribute with a given local name and namespace URI is specified on this element or has a default value,false
otherwise. This is a DOM method so namespace declarations are treated as attributes.- Specified by:
hasAttributeNS
in interfaceElement
- Overrides:
hasAttributeNS
in classAbstractNode
- Parameters:
namespaceURI
- The namespace URI of the attribute to look for.localName
- The local name of the attribute to look for.- Returns:
true
if an attribute with the given local name and namespace URI is specified or has a default value on this element,false
otherwise.- Since:
- DOM Level 2
-
getNamedItem
public Node getNamedItem(String name)
Get named attribute (DOM NamedNodeMap method) Treats namespace declarations as attributes.- Specified by:
getNamedItem
in interfaceNamedNodeMap
-
setNamedItem
public Node setNamedItem(Node arg) throws DOMException
Set named attribute (DOM NamedNodeMap method: always fails)- Specified by:
setNamedItem
in interfaceNamedNodeMap
- Throws:
DOMException
-
removeNamedItem
public Node removeNamedItem(String name) throws DOMException
Remove named attribute (DOM NamedNodeMap method: always fails)- Specified by:
removeNamedItem
in interfaceNamedNodeMap
- Throws:
DOMException
-
item
public Node item(int index)
Get n'th attribute (DOM NamedNodeMap method). Namespace declarations are not returned.- Specified by:
item
in interfaceNamedNodeMap
-
getLength
public int getLength()
Get number of attributes (DOM NamedNodeMap method). Treats namespace declarations as attributes.- Specified by:
getLength
in interfaceNamedNodeMap
- Overrides:
getLength
in classAbstractNode
-
getNamedItemNS
public Node getNamedItemNS(String uri, String localName)
Get named attribute (DOM NamedNodeMap method) Treats namespace declarations as attributes.- Specified by:
getNamedItemNS
in interfaceNamedNodeMap
-
setNamedItemNS
public Node setNamedItemNS(Node arg) throws DOMException
Set named attribute (DOM NamedNodeMap method: always fails)- Specified by:
setNamedItemNS
in interfaceNamedNodeMap
- Throws:
DOMException
-
removeNamedItemNS
public Node removeNamedItemNS(String uri, String localName) throws DOMException
Remove named attribute (DOM NamedNodeMap method: always fails)- Specified by:
removeNamedItemNS
in interfaceNamedNodeMap
- Throws:
DOMException
-
getSequenceNumber
protected final long getSequenceNumber()
Get the node sequence number (in document order). Sequence numbers are monotonic but not consecutive. In the current implementation, parent nodes (elements and roots) have a zero least-significant word, while namespaces, attributes, text nodes, comments, and PIs have the top word the same as their owner and the bottom half reflecting their relative position.- Overrides:
getSequenceNumber
in classNodeImpl
-
hasChildNodes
public final boolean hasChildNodes()
Determine if the node has any children.- Specified by:
hasChildNodes
in interfaceNode
- Specified by:
hasChildNodes
in interfaceNodeInfo
- Overrides:
hasChildNodes
in classNodeImpl
- Returns:
true
if the node has any children,false
if the node has no children.
-
enumerateChildren
public final AxisEnumeration enumerateChildren(NodeTest test)
Get an enumeration of the children of this node
-
getFirstChild
public final Node getFirstChild()
Get the first child node of the element- Specified by:
getFirstChild
in interfaceNode
- Overrides:
getFirstChild
in classNodeImpl
- Returns:
- the first child node of the required type, or null if there are no children
-
getLastChild
public final Node getLastChild()
Get the last child node of the element- Specified by:
getLastChild
in interfaceNode
- Overrides:
getLastChild
in classNodeImpl
- Returns:
- the last child of the element, or null if there are no children
-
getChildNodes
public final NodeList getChildNodes()
Return aNodeList
that contains all children of this node. If there are no children, this is aNodeList
containing no nodes.- Specified by:
getChildNodes
in interfaceNode
- Overrides:
getChildNodes
in classNodeImpl
-
getNthChild
protected final NodeImpl getNthChild(int n)
Get the nth child node of the element (numbering from 0)- Returns:
- the last child of the element, or null if there is no n'th child
-
getStringValue
public String getStringValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.- Returns:
- the accumulated character content of the element, including descendant elements.
-
copyStringValue
public void copyStringValue(Outputter out) throws TransformerException
Copy the string-value of this node to a given outputter- Specified by:
copyStringValue
in interfaceNodeInfo
- Overrides:
copyStringValue
in classAbstractNode
- Throws:
TransformerException
-
useChildrenArray
public void useChildrenArray(NodeImpl[] array)
Supply an array to be used for the array of children. For system use only.
-
addChild
public void addChild(NodeImpl node, int index)
Add a child node to this node. For system use only. Note: normalizing adjacent text nodes is the responsibility of the caller.
-
removeChild
public void removeChild(int index)
Remove node at given index. Will always be followed by a renumberChildren().
-
renumberChildren
public void renumberChildren()
Renumber the children of a given parent node. For system use only
-
dropChildren
public void dropChildren()
Drop a branch of the tree. The target element remains in the tree, but its children are disconnected from the parent. Unless there are other references to the children (e.g. in a variable) they will be deleted from memory next time the garbage collector comes round.
-
compact
public void compact(int size)
Compact the space used by this node
-
getNodeValue
public String getNodeValue()
Get the node value as defined in the DOM. This is not the same as the XPath string-value.- Specified by:
getNodeValue
in interfaceNode
- Overrides:
getNodeValue
in classAbstractNode
-
-