com.icl.saxon.tree

Class NamespaceImpl

final class NamespaceImpl extends NodeImpl

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: 3 November 1999

Author: Michael H. Kay

Constructor Summary
NamespaceImpl(ElementImpl element, int nsCode, int index)
Construct a Namespace node
Method Summary
voidcopy(Outputter out)
Copy this node to a given outputter
StringgenerateId()
Get sequential key.
StringgetLocalName()
Get the prefix of the namespace that this node relates to
intgetNameCode()
Get the namecode for this name.
intgetNamespaceCode()
Get the namespace code for this prefix/uri pair.
NodeImplgetNextInDocument(NodeImpl anchor)
Get the next node in document order (skipping namespace nodes)
NodegetNextSibling()
Get next sibling - not defined for namespace nodes
StringgetNodeName()
Get the name of this node, following the DOM rules (which aren't actually defined for Namespace nodes...)
shortgetNodeType()
Return the type of node.
NodeImplgetPreviousInDocument()
Get the previous node in document order (skipping namespace nodes)
NodegetPreviousSibling()
Get previous sibling - not defined for namespace nodes
protected longgetSequenceNumber()
Get the node sequence number (in document order).
StringgetStringValue()
Return the string value of the node.
booleanisSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
voidsetNamespaceCode(int nsCode)
Change the uri of the namespace that this node relates to (used to implement xsl:namespace-alias)

Constructor Detail

NamespaceImpl

public NamespaceImpl(ElementImpl element, int nsCode, int index)
Construct a Namespace node

Parameters: element The element owning the namespace node nsCode The namespace code index Integer identifying this namespace node among the nodes for its parent

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 namespace prefix as a suffix

getLocalName

public String getLocalName()
Get the prefix of the namespace that this node relates to

getNameCode

public int getNameCode()
Get the namecode for this name. Not the same as the namespace code!

getNamespaceCode

public int getNamespaceCode()
Get the namespace code for this prefix/uri pair. Not the same as the name code!

getNextInDocument

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

getNextSibling

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

getNodeName

public String getNodeName()
Get the name of this node, following the DOM rules (which aren't actually defined for Namespace nodes...)

Returns: the namespace prefix

getNodeType

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

Returns: NodeInfo.NAMESPACE

getPreviousInDocument

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

getPreviousSibling

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

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 string value of the node.

Returns: the namespace uri

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.

setNamespaceCode

public void setNamespaceCode(int nsCode)
Change the uri of the namespace that this node relates to (used to implement xsl:namespace-alias)