com.icl.saxon.tree

Class NamespaceImpl

Implemented Interfaces:
DOMLocator, Node, NodeInfo, Source, SourceLocator

(package private) 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

Field Summary

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 com.icl.saxon.om.NodeInfo

ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT

Constructor Summary

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

Method Summary

void
copy(Outputter out)
Copy this node to a given outputter
String
generateId()
Get sequential key.
String
getLocalName()
Get the prefix of the namespace that this node relates to
int
getNameCode()
Get the namecode for this name.
int
getNamespaceCode()
Get the namespace code for this prefix/uri pair.
NodeImpl
getNextInDocument(NodeImpl anchor)
Get the next node in document order (skipping namespace nodes)
Node
getNextSibling()
Get next sibling - not defined for namespace nodes
String
getNodeName()
Get the name of this node, following the DOM rules (which aren't actually defined for Namespace nodes...)
short
getNodeType()
Return the type of node.
NodeImpl
getPreviousInDocument()
Get the previous node in document order (skipping namespace nodes)
Node
getPreviousSibling()
Get previous sibling - not defined for namespace nodes
protected long
getSequenceNumber()
Get the node sequence number (in document order).
String
getStringValue()
Return the string value of the node.
boolean
isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
void
setNamespaceCode(int nsCode)
Change the uri of the namespace that this node relates to (used to implement xsl:namespace-alias)

Methods inherited from class com.icl.saxon.tree.NodeImpl

compareOrder, generateId, getAttributeValue, getAttributeValue, getAttributes, getBaseURI, getChildNodes, getDisplayName, getDocumentElement, getDocumentRoot, getEnumeration, getFingerprint, getFirstChild, getLastChild, getLineNumber, getLocalName, getNameCode, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getSequenceNumber, getSystemId, getURI, hasAttributes, hasChildNodes, isSameNodeInfo, outputNamespaceNodes, removeNode, setSystemId

Methods inherited from class com.icl.saxon.om.AbstractNode

appendChild, appendData, cloneNode, compareDocumentPosition, compareOrder, copyStringValue, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, generateId, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributeValue, getAttributeValue, getAttributes, getBaseURI, getChildNodes, getColumnNumber, getData, getDisplayName, getDoctype, getDocumentElement, getDocumentRoot, getElementById, getElementsByTagName, getElementsByTagNameNS, getEnumeration, getFeature, getFingerprint, getFirstChild, getImplementation, getLastChild, getLength, getLineNumber, getLocalName, getName, getNameCode, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOriginatingNode, getOwnerDocument, getOwnerElement, getParent, getParentNode, getPrefix, getPreviousSibling, getPublicId, getSchemaTypeInfo, getSpecified, getSystemId, getTagName, getTextContent, getURI, getUserData, getValue, getWholeText, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isId, isSameNode, isSameNodeInfo, isSupported, lookupNamespaceURI, lookupPrefix, normalize, outputNamespaceNodes, removeAttribute, removeAttributeNS, removeAttributeNode, removeChild, replaceChild, replaceData, replaceWholeText, setAttributeNS, setAttributeNode, setAttributeNodeNS, setData, setIdAttribute, setIdAttributeNS, setIdAttributeNode, setNodeValue, setPrefix, setTextContent, setUserData, setValue, splitText, substringData, supports

Constructor Details

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 Details

copy

public void copy(Outputter out)
            throws TransformerException
Copy this node to a given outputter
Specified by:
copy in interface NodeInfo

generateId

public String generateId()
Get sequential key. Returns key of owning element with the namespace prefix as a suffix
Specified by:
generateId in interface NodeInfo
Overrides:
generateId in interface NodeImpl

getLocalName

public String getLocalName()
Get the prefix of the namespace that this node relates to
Specified by:
getLocalName in interface NodeInfo
Overrides:
getLocalName in interface NodeImpl

getNameCode

public int getNameCode()
Get the namecode for this name. Not the same as the namespace code!
Specified by:
getNameCode in interface NodeInfo
Overrides:
getNameCode in interface NodeImpl

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)
Overrides:
getNextInDocument in interface NodeImpl

getNextSibling

public Node getNextSibling()
Get next sibling - not defined for namespace nodes
Overrides:
getNextSibling in interface NodeImpl

getNodeName

public String getNodeName()
Get the name of this node, following the DOM rules (which aren't actually defined for Namespace nodes...)
Overrides:
getNodeName in interface AbstractNode
Returns:
the namespace prefix

getNodeType

public final short getNodeType()
Return the type of node.
Specified by:
getNodeType in interface NodeInfo
Returns:
NodeInfo.NAMESPACE

getPreviousInDocument

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

getPreviousSibling

public Node getPreviousSibling()
Get previous sibling - not defined for namespace nodes
Overrides:
getPreviousSibling in interface NodeImpl

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 interface NodeImpl

getStringValue

public String getStringValue()
Return the string value of the node.
Specified by:
getStringValue in interface NodeInfo
Returns:
the namespace uri

isSameNodeInfo

public boolean isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
Specified by:
isSameNodeInfo in interface NodeInfo
Overrides:
isSameNodeInfo in interface NodeImpl
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)