com.icl.saxon.tree

Class AttributeImpl

final class AttributeImpl extends NodeImpl implements 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: Michael H. Kay

Constructor Summary
AttributeImpl(ElementImpl element, int index)
Construct an Attribute node for the n'th attribute of a given element
Method Summary
voidcopy(Outputter out)
Copy this node to a given outputter
StringgenerateId()
Get sequential key.
intgetNameCode()
Get the name code, which enables the name to be located in the name pool
NodeImplgetNextInDocument(NodeImpl anchor)
Get the next node in document order (skipping attributes)
NodegetNextSibling()
Get next sibling - not defined for attributes
shortgetNodeType()
Return the type of node.
NodeImplgetPreviousInDocument()
Get the previous node in document order (skipping attributes)
NodegetPreviousSibling()
Get previous sibling - not defined for attributes
protected longgetSequenceNumber()
Get the node sequence number (in document order).
StringgetStringValue()
Return the character value of the node.
booleanisSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node

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

Method Detail

copy

public void copy(Outputter out)
Copy this node to a given outputter

generateId

public String generateId()
Get sequential key. Returns key of owning element with the attribute name as a suffix

getNameCode

public int getNameCode()
Get the name code, which enables the name to be located in the name pool

getNextInDocument

public NodeImpl getNextInDocument(NodeImpl anchor)
Get the next node in document order (skipping attributes)

getNextSibling

public Node getNextSibling()
Get next sibling - not defined for attributes

getNodeType

public final short getNodeType()
Return the type of node.

Returns: Node.ATTRIBUTE

getPreviousInDocument

public NodeImpl getPreviousInDocument()
Get the previous node in document order (skipping attributes)

getPreviousSibling

public Node getPreviousSibling()
Get previous sibling - not defined for attributes

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.

getStringValue

public String getStringValue()
Return the character value of the node.

Returns: the attribute value

isSameNodeInfo

public boolean isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node

Returns: true if this Node object and the supplied Node object represent the same node in the tree.