Package com.icl.saxon.tinytree
Class TinyElementImpl
java.lang.Object
com.icl.saxon.om.AbstractNode
com.icl.saxon.tinytree.TinyNodeImpl
com.icl.saxon.tinytree.TinyParentNodeImpl
com.icl.saxon.tinytree.TinyElementImpl
- All Implemented Interfaces:
NodeInfo
,DOMLocator
,Source
,SourceLocator
,Element
,Node
A node in the XML parse tree representing an XML element.
This class is an implementation of NodeInfo and also implements the DOM Element interface
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class com.icl.saxon.tinytree.TinyNodeImpl
document, nodeNr, 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Copy this node to a given outputter (supporting xsl:copy-of)void
Copy this node to a given outputtergetAttributeValue
(int fingerprint) Get the value of a given attribute of this nodegetAttributeValue
(String uri, String localName) Find the value of a given attribute of this node.Get the base URI of this element node.final short
Return the type of node.boolean
Returns whether this node (if it is an element) has any attributes.makeAttributeNode
(int index) Make an attribute node for a given attribute of this elementvoid
outputNamespaceNodes
(Outputter out, boolean includeAncestors) Output all namespace nodes associated with this element.void
setAttribute
(String name, String value) Set the value of an attribute on the current element.Methods inherited from class com.icl.saxon.tinytree.TinyParentNodeImpl
copyStringValue, getStringValue, hasChildNodes
Methods inherited from class com.icl.saxon.tinytree.TinyNodeImpl
compareOrder, generateId, getDisplayName, getDocumentRoot, getEnumeration, getFingerprint, getLineNumber, getLocalName, getNameCode, getOriginatingNode, getParent, getPrefix, getSequenceNumber, getSystemId, getURI, isSameNodeInfo, setLineNumber, setParentNode, setSystemId
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, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildNodes, getColumnNumber, getData, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getFirstChild, getImplementation, getLastChild, getLength, getName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getOwnerElement, getParentNode, getPreviousSibling, getPublicId, getSchemaTypeInfo, getSpecified, getTagName, getTextContent, getUserData, getValue, getWholeText, hasAttribute, hasAttributeNS, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isId, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, replaceWholeText, setAttributeNode, setAttributeNodeNS, setAttributeNS, 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
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Constructor Details
-
TinyElementImpl
Constructor
-
-
Method Details
-
getNodeType
public final short getNodeType()Return the type of node.- Specified by:
getNodeType
in interfaceNode
- Specified by:
getNodeType
in interfaceNodeInfo
- Returns:
- NodeInfo.ELEMENT
-
getBaseURI
Get the base URI of this element node. This will be the same as the System ID unless xml:base has been used.- Specified by:
getBaseURI
in interfaceNode
- Specified by:
getBaseURI
in interfaceNodeInfo
- Overrides:
getBaseURI
in classTinyNodeImpl
-
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 classTinyNodeImpl
- Parameters:
out
- The relevant outputterincludeAncestors
- True if namespaces associated with ancestor elements must also be output; false if these are already known to be on the result tree.- Throws:
TransformerException
-
hasAttributes
public boolean hasAttributes()Returns whether this node (if it is an element) has any attributes.- Specified by:
hasAttributes
in interfaceNode
- Overrides:
hasAttributes
in classTinyNodeImpl
- Returns:
true
if this node has any attributes,false
otherwise.- Since:
- DOM Level 2
-
getAttributeValue
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 classTinyNodeImpl
- 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
Get the value of a given attribute of this node- Specified by:
getAttributeValue
in interfaceNodeInfo
- Overrides:
getAttributeValue
in classTinyNodeImpl
- Parameters:
fingerprint
- The fingerprint of the attribute name- Returns:
- the attribute value if it exists or null if not
-
makeAttributeNode
Make an attribute node for a given attribute of this element- Parameters:
index
- The relative position of the attribute, counting from zero. This is trusted to be in range.
-
setAttribute
Set the value of an attribute on the current element. This affects subsequent calls of getAttribute() for that element.- Specified by:
setAttribute
in interfaceElement
- 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
-
copy
Copy this node to a given outputter (supporting xsl:copy-of)- Specified by:
copy
in interfaceNodeInfo
- Throws:
TransformerException
-
copy
Copy this node to a given outputter- Parameters:
allNamespaces
- true if all namespace nodes must be copied; false if namespace nodes for the parent element are already on the result tree- Throws:
TransformerException
-