Package com.icl.saxon.tree
Class NamespaceImpl
java.lang.Object
com.icl.saxon.om.AbstractNode
com.icl.saxon.tree.NodeImpl
com.icl.saxon.tree.NamespaceImpl
- All Implemented Interfaces:
NodeInfo
,DOMLocator
,Source
,SourceLocator
,Node
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, 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_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Constructor Summary
ConstructorsConstructorDescriptionNamespaceImpl
(ElementImpl element, int nsCode, int index) Construct a Namespace node -
Method Summary
Modifier and TypeMethodDescriptionvoid
Copy this node to a given outputterGet sequential key.Get the prefix of the namespace that this node relates toint
Get the namecode for this name.int
Get the namespace code for this prefix/uri pair.getNextInDocument
(NodeImpl anchor) Get the next node in document order (skipping namespace nodes)Get next sibling - not defined for namespace nodesGet the name of this node, following the DOM rules (which aren't actually defined for Namespace nodes...)final short
Return the type of node.Get the previous node in document order (skipping namespace nodes)Get previous sibling - not defined for namespace nodesprotected long
Get the node sequence number (in document order).Return the string value of the node.boolean
isSameNodeInfo
(NodeInfo other) Determine whether this is the same node as another nodevoid
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, getAttributes, getAttributeValue, getAttributeValue, getBaseURI, getChildNodes, getDisplayName, getDocumentElement, getDocumentRoot, getEnumeration, getFingerprint, getFirstChild, getLastChild, getLineNumber, getNamePool, getOriginatingNode, getParent, getPrefix, getSystemId, getURI, hasAttributes, hasChildNodes, outputNamespaceNodes, removeNode, setSystemId
Methods inherited from class com.icl.saxon.om.AbstractNode
appendChild, appendData, cloneNode, compareDocumentPosition, copyStringValue, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getColumnNumber, getData, getDoctype, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getLength, getName, getNamespaceURI, getNodeValue, getOwnerDocument, getOwnerElement, getParentNode, getPublicId, getSchemaTypeInfo, getSpecified, getTagName, getTextContent, getUserData, getValue, getWholeText, hasAttribute, hasAttributeNS, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isId, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, replaceWholeText, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setUserData, setValue, splitText, substringData, supports
-
Constructor Details
-
NamespaceImpl
Construct a Namespace node- Parameters:
element
- The element owning the namespace nodensCode
- The namespace codeindex
- Integer identifying this namespace node among the nodes for its parent
-
-
Method Details
-
getNameCode
public int getNameCode()Get the namecode for this name. Not the same as the namespace code!- Specified by:
getNameCode
in interfaceNodeInfo
- Overrides:
getNameCode
in classNodeImpl
- See Also:
-
getNamespaceCode
public int getNamespaceCode()Get the namespace code for this prefix/uri pair. Not the same as the name code! -
isSameNodeInfo
Determine whether this is the same node as another node- Specified by:
isSameNodeInfo
in interfaceNodeInfo
- Overrides:
isSameNodeInfo
in classNodeImpl
- Returns:
- true if this Node object and the supplied Node object represent the same node in the tree.
-
getLocalName
Get the prefix of the namespace that this node relates to- Specified by:
getLocalName
in interfaceNode
- Specified by:
getLocalName
in interfaceNodeInfo
- Overrides:
getLocalName
in classNodeImpl
- Returns:
- The local name of this node. For a node with no name, return an empty string.
-
setNamespaceCode
public void setNamespaceCode(int nsCode) Change the uri of the namespace that this node relates to (used to implement xsl:namespace-alias) -
getNodeType
public final short getNodeType()Return the type of node.- Returns:
- NodeInfo.NAMESPACE
-
getStringValue
Return the string value of the node.- Returns:
- the namespace uri
-
getNodeName
Get the name of this node, following the DOM rules (which aren't actually defined for Namespace nodes...)- Specified by:
getNodeName
in interfaceNode
- Overrides:
getNodeName
in classAbstractNode
- Returns:
- the namespace prefix
-
getNextSibling
Get next sibling - not defined for namespace nodes- Specified by:
getNextSibling
in interfaceNode
- Overrides:
getNextSibling
in classNodeImpl
- Returns:
- The next sibling node of the required type. Returns null if the current node is the last child of its parent.
-
getPreviousSibling
Get previous sibling - not defined for namespace nodes- Specified by:
getPreviousSibling
in interfaceNode
- Overrides:
getPreviousSibling
in classNodeImpl
- Returns:
- The previous sibling node. Returns null if the current node is the first child of its parent.
-
getPreviousInDocument
Get the previous node in document order (skipping namespace nodes)- Overrides:
getPreviousInDocument
in classNodeImpl
- Returns:
- the previous node in the document, or null if there is no such node
-
getNextInDocument
Get the next node in document order (skipping namespace nodes)- Overrides:
getNextInDocument
in classNodeImpl
- 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
Get sequential key. Returns key of owning element with the namespace prefix as a suffix- Specified by:
generateId
in interfaceNodeInfo
- Overrides:
generateId
in classNodeImpl
- Returns:
- a string.
-
copy
Copy this node to a given outputter- Throws:
TransformerException
-
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 classNodeImpl
-