com.icl.saxon.tinytree

Class TinyNamespaceImpl

final class TinyNamespaceImpl extends TinyNodeImpl

A node in the XML parse tree representing a Namespace. Note that this is generated only "on demand", when the namespace axis is expanded.

Version: 28 September 2000

Author: Michael H. Kay

Constructor Summary
TinyNamespaceImpl(TinyDocumentImpl doc, int nodeNr)
Method Summary
voidcopy(Outputter out)
Copy this node to a given outputter
StringgenerateId()
Get unique identifier.
StringgetDisplayName()
Get the display name of this node.
intgetFingerprint()
Get the fingerprint
StringgetLocalName()
Get the local name of this node.
intgetNameCode()
Get the nameCode, for name matching
intgetNamespaceCode()
Get the namespace code (a numeric representation of the prefix and URI)
shortgetNodeType()
Return the type of node.
NodeInfogetParent()
Get the parent element of this namespace node
StringgetPrefix()
Get the prefix part of the name of this node.
protected longgetSequenceNumber()
Get the node sequence number (in document order).
StringgetStringValue()
Return the string value of the node.
StringgetURI()
Get the URI part of the name of this node.
booleanisSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
voidsetParentNode(int nodeNr)
Set the parent element for this namespace node

Constructor Detail

TinyNamespaceImpl

public TinyNamespaceImpl(TinyDocumentImpl doc, int nodeNr)

Method Detail

copy

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

generateId

public String generateId()
Get unique identifier. Returns key of owning element with the name fingerprint as a suffix

getDisplayName

public String getDisplayName()
Get the display name of this node. For namespaces this is the namespace prefix.

Returns: The display name of this node. For a node with no name, return an empty string.

getFingerprint

public int getFingerprint()
Get the fingerprint

getLocalName

public String getLocalName()
Get the local name of this node. For namespaces this is the namespace prefix.

Returns: The local name of this node.

getNameCode

public int getNameCode()
Get the nameCode, for name matching

getNamespaceCode

public int getNamespaceCode()
Get the namespace code (a numeric representation of the prefix and URI)

getNodeType

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

Returns: NodeInfo.NAMESPACE

getParent

public NodeInfo getParent()
Get the parent element of this namespace node

getPrefix

public String getPrefix()
Get the prefix part of the name of this node. This is the name before the ":" if any.

Returns: the prefix part of the name. Always null.

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 final String getStringValue()
Return the string value of the node.

Returns: the namespace uri

getURI

public String getURI()
Get the URI part of the name of this node.

Returns: The URI of the namespace of this node. Always null.

isSameNodeInfo

public final 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.

setParentNode

void setParentNode(int nodeNr)
Set the parent element for this namespace node