com.icl.saxon.tree
Class AttributeImpl

java.lang.Object
  |
  +--com.icl.saxon.om.AbstractNode
        |
        +--com.icl.saxon.tree.NodeImpl
              |
              +--com.icl.saxon.tree.AttributeImpl
All Implemented Interfaces:
org.w3c.dom.Attr, javax.xml.transform.dom.DOMLocator, org.w3c.dom.Node, NodeInfo, javax.xml.transform.Source, javax.xml.transform.SourceLocator

final class AttributeImpl
extends NodeImpl
implements org.w3c.dom.Attr

A node in the XML parse tree representing an attribute. Note that this is generated only "on demand", when the attribute is selected by a select pattern.

Author:
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_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface com.icl.saxon.om.NodeInfo
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT
 
Constructor Summary
AttributeImpl(ElementImpl element, int index)
          Construct an Attribute node for the n'th attribute of a given element
 
Method Summary
 void copy(Outputter out)
          Copy this node to a given outputter
 java.lang.String generateId()
          Get sequential key.
 int getNameCode()
          Get the name code, which enables the name to be located in the name pool
 NodeImpl getNextInDocument(NodeImpl anchor)
          Get the next node in document order (skipping attributes)
 org.w3c.dom.Node getNextSibling()
          Get next sibling - not defined for attributes
 short getNodeType()
          Return the type of node.
 NodeImpl getPreviousInDocument()
          Get the previous node in document order (skipping attributes)
 org.w3c.dom.Node getPreviousSibling()
          Get previous sibling - not defined for attributes
protected  long getSequenceNumber()
          Get the node sequence number (in document order).
 java.lang.String getStringValue()
          Return the character value of the node.
 boolean isSameNode(NodeInfo other)
          Determine whether this is the same node as another node
 
Methods inherited from class com.icl.saxon.tree.NodeImpl
compareOrder, getAttributes, getAttributeValue, getAttributeValue, getBaseURI, getChildNodes, getDisplayName, getDocumentElement, getDocumentRoot, getEnumeration, getFingerprint, getFirstChild, getLastChild, getLineNumber, getLocalName, getNamePool, getOriginatingNode, getParent, getPrefix, getSystemId, getURI, hasAttributes, hasChildNodes, outputNamespaceNodes, removeNode, setSystemId
 
Methods inherited from class com.icl.saxon.om.AbstractNode
appendChild, appendData, cloneNode, copyStringValue, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getColumnNumber, getData, getDoctype, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getLength, getName, getNamespaceURI, getNodeName, getNodeValue, getOwnerDocument, getOwnerElement, getParentNode, getPublicId, getSpecified, getTagName, getValue, hasAttribute, hasAttributeNS, importNode, insertBefore, insertData, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, 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.Attr
getName, getOwnerElement, getSpecified, getValue, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

AttributeImpl

public AttributeImpl(ElementImpl element,
                     int index)
Construct an Attribute node for the n'th attribute of a given element
Parameters:
element - The element containing the relevant attribute
index - The index position of the attribute starting at zero
sequenceBase - The sequence number to be allocated to the first attribute node. Note that attributes appear in document order AFTER namespace nodes, so we can't deduce this from the index alone.
Method Detail

getNameCode

public int getNameCode()
Get the name code, which enables the name to be located in the name pool
Overrides:
getNameCode in class NodeImpl
Following copied from interface: com.icl.saxon.om.NodeInfo
See Also:
allocate, getFingerprint

isSameNode

public boolean isSameNode(NodeInfo other)
Determine whether this is the same node as another node
Overrides:
isSameNode in class NodeImpl
Returns:
true if this Node object and the supplied Node object represent the same node in the tree.

getSequenceNumber

protected 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 class NodeImpl

getNodeType

public final short getNodeType()
Return the type of node.
Specified by:
getNodeType in interface org.w3c.dom.Node
Returns:
Node.ATTRIBUTE

getStringValue

public java.lang.String getStringValue()
Return the character value of the node.
Returns:
the attribute value

getNextSibling

public org.w3c.dom.Node getNextSibling()
Get next sibling - not defined for attributes
Specified by:
getNextSibling in interface org.w3c.dom.Node
Overrides:
getNextSibling in class NodeImpl
Following copied from class: com.icl.saxon.tree.NodeImpl
Returns:
The next sibling node of the required type. Returns null if the current node is the last child of its parent.

getPreviousSibling

public org.w3c.dom.Node getPreviousSibling()
Get previous sibling - not defined for attributes
Specified by:
getPreviousSibling in interface org.w3c.dom.Node
Overrides:
getPreviousSibling in class NodeImpl
Following copied from class: com.icl.saxon.tree.NodeImpl
Returns:
The previous sibling node. Returns null if the current node is the first child of its parent.

getPreviousInDocument

public NodeImpl getPreviousInDocument()
Get the previous node in document order (skipping attributes)
Overrides:
getPreviousInDocument in class NodeImpl
Following copied from class: com.icl.saxon.tree.NodeImpl
Returns:
the previous node in the document, or null if there is no such node

getNextInDocument

public NodeImpl getNextInDocument(NodeImpl anchor)
Get the next node in document order (skipping attributes)
Overrides:
getNextInDocument in class NodeImpl
Following copied from class: com.icl.saxon.tree.NodeImpl
Parameters:
anchor: - the scan stops when it reaches a node that is not a descendant of the specified anchor node
Returns:
the next node in the document, or null if there is no such node

generateId

public java.lang.String generateId()
Get sequential key. Returns key of owning element with the attribute name as a suffix
Overrides:
generateId in class NodeImpl
Following copied from class: com.icl.saxon.tree.NodeImpl
Returns:
a string.

copy

public void copy(Outputter out)
          throws javax.xml.transform.TransformerException
Copy this node to a given outputter