|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.icl.saxon.tree.NodeImpl
|
+--com.icl.saxon.tree.NamespaceImpl
A node in the XML parse tree representing a Namespace. Note that this is generated only "on demand", when the namespace axis is expanded.
| Field Summary | |
protected static NodeInfo[] |
emptyArray
|
protected int |
index
|
protected com.icl.saxon.tree.ParentNodeImpl |
parent
|
| Fields inherited from interface com.icl.saxon.om.NodeInfo |
ATTRIBUTE, COMMENT, DOCUMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, TEXT |
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
| Constructor Summary | |
NamespaceImpl(ElementImpl element,
java.lang.String prefix,
java.lang.String uri,
int index)
Construct a Namespace node |
|
| Method Summary | |
protected static java.lang.String |
alphaKey(int value)
Construct an alphabetic key from an positive integer; the key collates in the same sequence as the integer |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of children
of this node. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
void |
copy(Outputter out)
Copy this node to a given outputter |
void |
copyStringValue(Outputter out)
Copy the string-value of this node to a given outputter |
void |
defaultAction(Context c)
Perform default action for this kind of node (built-in template rule) |
protected void |
disallowUpdate()
Internal method used to indicate that update operations are not allowed |
java.lang.String |
getAbsoluteName()
Get the absolute name of this node. |
NodeInfo[] |
getAllChildNodes()
Get all child nodes of the node - default implementation used for leaf nodes |
ElementInfo |
getAncestor(Name name)
Get the nearest ancestor element with a given name |
NodeInfo |
getAncestor(Pattern pat,
Context c)
Get the nearest ancestor node that matches the given pattern |
org.w3c.dom.NamedNodeMap |
getAttributes()
Return a NamedNodeMap containing the attributes of this node (if
it is an Element ) or null otherwise. |
java.lang.String |
getAttributeValue(Name name)
Find the value of a given attribute of this node. |
java.lang.String |
getAttributeValue(java.lang.String name)
Find the value of a given attribute of this node. |
org.w3c.dom.NodeList |
getChildNodes()
Return a NodeList that contains all children of this node. |
int |
getColumnNumber()
Get the column number of the node. |
java.lang.String |
getDisplayName()
Get the display name of this node. |
org.w3c.dom.Element |
getDocumentElement()
Get the outermost element. |
DocumentInfo |
getDocumentRoot()
Get the root (document) node |
Name |
getExpandedName()
Get the name of this namespace node |
org.w3c.dom.Node |
getFirstChild()
Get first child - default implementation used for leaf nodes |
NodeInfo |
getFirstChild(Pattern pattern,
Context c)
Get the first child node matching a given pattern |
int |
getIndex()
Get the index of this node, i.e. |
org.w3c.dom.Node |
getLastChild()
Get last child - default implementation used for leaf nodes |
NodeInfo |
getLastChild(Pattern pattern,
Context c)
Get the last child node matching a given pattern |
int |
getLineNumber()
Get the line number of the node within its source document entity |
java.lang.String |
getLocalName()
Get the local name of this node. |
java.lang.String |
getNamespacePrefix()
Get the prefix of the namespace that this node relates to |
java.lang.String |
getNamespaceURI()
Get the uri of the namespace that this node relates to |
NodeInfo |
getNextInDocument()
Get the next node in document order. |
NodeInfo |
getNextInDocument(NodeInfo anchor)
Get the next node in document order |
org.w3c.dom.Node |
getNextSibling()
Get next sibling - not defined for namespace nodes |
NodeInfo |
getNextSibling(Pattern pattern,
Context c)
Get the next sibling node that matches a given pattern. |
java.lang.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. |
static java.lang.String |
getNodeTypeName(int type)
Translate numeric node type to a string representation |
java.lang.String |
getNodeValue()
Get the node value as defined in the DOM. |
int |
getNumberAny(Pattern count,
Pattern from)
Get node number, level=any. |
int |
getNumberAny(Pattern count,
Pattern from,
Context context)
Get node number (level="any"). |
java.util.Vector |
getNumberMulti(Pattern count,
Pattern from)
Get node number, level=multi. |
java.util.Vector |
getNumberMulti(Pattern count,
Pattern from,
Context context)
Get node number (level="multi"). |
int |
getNumberOfChildren()
Get the number of children. |
int |
getNumberSimple()
Get simple node number. |
int |
getNumberSimple(Context context)
Get simple node number. |
int |
getNumberSingle(Pattern count,
Pattern from)
Get node number, level=single. |
int |
getNumberSingle(Pattern count,
Pattern from,
Context context)
Get node number (level="single"). |
org.w3c.dom.Document |
getOwnerDocument()
Return the Document object associated with this node. |
org.w3c.dom.Node |
getParentNode()
Find the parent node of this node. |
java.lang.String |
getPath()
Generate a path to this node |
java.lang.String |
getPrefix()
Get the prefix part of the name of this node. |
NodeInfo |
getPreviousInDocument()
Get the previous node in document order. |
NodeInfo |
getPreviousInDocument(Pattern pattern,
Context c)
Get the previous node in document order |
org.w3c.dom.Node |
getPreviousSibling()
Get previous sibling - not defined for namespace nodes |
NodeInfo |
getPreviousSibling(Pattern pattern,
Context c)
Get the previous sibling of the node that matches a given pattern. |
java.lang.String |
getPublicId()
Get the public identifier of the document entity containing this node. |
long |
getSequenceNumber()
Get the node sequence number (in document order). |
java.lang.String |
getSequentialKey()
Get sequential key. |
java.lang.String |
getSystemId()
Get the base URL for the node. |
java.lang.String |
getURI()
Get the URI part of the name of this node. |
java.lang.String |
getValue()
Return the string value of the node. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
Determine whether the node has any children. |
boolean |
hasName(Name name)
Test if the name of the node (including namespaces) is equivalent to the given name |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Insert the node newChild before the existing child node
refChild. |
boolean |
isa(int nodeType)
Determine whether the node is of a given type. |
boolean |
isAncestor(NodeInfo other)
Determine whether this node is an ancestor of another node |
boolean |
isDocumentElement()
Determine whether this node is the outermost element. |
boolean |
isSameNode(NodeInfo other)
Determine whether this is the same node as another node |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Test if the DOM implementation implements a specific feature. |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Remove the child node indicated by oldChild from the
list of children, and returns it. |
void |
removeNode()
Remove this node from the tree. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replace the child node oldChild with
newChild in the list of children, and returns the
oldChild node. |
void |
setNamespacePrefix(java.lang.String prefix)
Set the prefix of the namespace that this node relates to |
void |
setNamespaceURI(java.lang.String uri)
Set the uri of the namespace that this node relates to |
void |
setNodeValue(java.lang.String nodeValue)
Set the node value. |
void |
setPrefix(java.lang.String prefix)
Set the namespace prefix of this node. |
boolean |
supports(java.lang.String feature,
java.lang.String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
java.lang.String |
toString()
Diagnostic output |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.icl.saxon.om.NodeInfo |
copyStringValue, getAbsoluteName, getAllChildNodes, getAncestor, getAncestor, getAttributeValue, getAttributeValue, getDisplayName, getDocumentElement, getDocumentRoot, getFirstChild, getIndex, getLastChild, getLineNumber, getLocalName, getNextInDocument, getNextSibling, getNumberAny, getNumberMulti, getNumberOfChildren, getNumberSimple, getNumberSimple, getNumberSingle, getPrefix, getPreviousInDocument, getPreviousSibling, getSystemId, getURI, hasName, isa, isAncestor, isDocumentElement |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getNodeValue, getOwnerDocument, getParentNode, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Field Detail |
protected static NodeInfo[] emptyArray
protected com.icl.saxon.tree.ParentNodeImpl parent
protected int index
| Constructor Detail |
public NamespaceImpl(ElementImpl element,
java.lang.String prefix,
java.lang.String uri,
int index)
throws org.xml.sax.SAXException
element - The element containing the relevant attributeprefix - The namespace prefix (empty string for the default namespace)uri - The namespace uriindex - Integer identifying this namespace node among the nodes for its parent| Method Detail |
public boolean isSameNode(NodeInfo other)
isSameNode in interface NodeInfoisSameNode in class com.icl.saxon.tree.NodeImplpublic java.lang.String getNamespacePrefix()
getNamespacePrefix in interface NamespaceInfopublic java.lang.String getNamespaceURI()
getNamespaceURI in interface NamespaceInfogetNamespaceURI in class com.icl.saxon.tree.NodeImplpublic void setNamespacePrefix(java.lang.String prefix)
setNamespacePrefix in interface NamespaceInfopublic void setNamespaceURI(java.lang.String uri)
setNamespaceURI in interface NamespaceInfopublic final short getNodeType()
getNodeType in interface NodeInfopublic java.lang.String getValue()
getValue in interface NodeInfopublic Name getExpandedName()
getExpandedName in interface NodeInfopublic java.lang.String getNodeName()
getNodeName in interface NodeInfogetNodeName in class com.icl.saxon.tree.NodeImplpublic org.w3c.dom.Node getNextSibling()
getNextSibling in interface org.w3c.dom.NodegetNextSibling in class com.icl.saxon.tree.NodeImplcom.icl.saxon.tree.NodeImplpublic org.w3c.dom.Node getPreviousSibling()
getPreviousSibling in interface org.w3c.dom.NodegetPreviousSibling in class com.icl.saxon.tree.NodeImplcom.icl.saxon.tree.NodeImplpublic NodeInfo getPreviousInDocument()
getPreviousInDocument in interface NodeInfogetPreviousInDocument in class com.icl.saxon.tree.NodeImplcom.icl.saxon.om.NodeInfopublic NodeInfo getNextInDocument()
SAXException, - always
public int getNumberSingle(Pattern count,
Pattern from)
throws org.xml.sax.SAXException
org.xml.sax.SAXException -
public int getNumberAny(Pattern count,
Pattern from)
throws org.xml.sax.SAXException
org.xml.sax.SAXException -
public java.util.Vector getNumberMulti(Pattern count,
Pattern from)
throws org.xml.sax.SAXException
org.xml.sax.SAXException - public java.lang.String getSequentialKey()
getSequentialKey in interface NodeInfogetSequentialKey in class com.icl.saxon.tree.NodeImplcom.icl.saxon.om.NodeInfo
public void copy(Outputter out)
throws org.xml.sax.SAXException
copy in interface NodeInfopublic void defaultAction(Context c)
defaultAction in interface NodeInfopublic long getSequenceNumber()
getSequenceNumber in interface NodeInfogetSequenceNumber in class com.icl.saxon.tree.NodeImplpublic java.lang.String getPath()
getPath in interface NodeInfopublic java.lang.String toString()
toString in class com.icl.saxon.tree.NodeImplpublic java.lang.String getSystemId()
getSystemId in interface NodeInfocom.icl.saxon.om.NodeInfopublic java.lang.String getPrefix()
getPrefix in interface NodeInfopublic java.lang.String getURI()
getURI in interface NodeInfopublic java.lang.String getDisplayName()
getDisplayName in interface NodeInfopublic java.lang.String getAbsoluteName()
getAbsoluteName in interface NodeInfopublic java.lang.String getLocalName()
getLocalName in interface NodeInfopublic boolean hasName(Name name)
hasName in interface NodeInfopublic int getLineNumber()
getLineNumber in interface NodeInfocom.icl.saxon.om.NodeInfopublic int getColumnNumber()
public java.lang.String getPublicId()
public final int getIndex()
getIndex in interface NodeInfocom.icl.saxon.om.NodeInfopublic final org.w3c.dom.Node getParentNode()
getParentNode in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getFirstChild()
getFirstChild in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getLastChild()
getLastChild in interface org.w3c.dom.Nodepublic int getNumberOfChildren()
getNumberOfChildren in interface NodeInfopublic NodeInfo[] getAllChildNodes()
getAllChildNodes in interface NodeInfopublic final boolean isa(int nodeType)
Note, this can also be done by testing the node using "instanceof". But this is inconvenient when passing the class as a parameter to another routine.
isa in interface NodeInfonodeType - One of the specific node types such as ELEMENT or TEXT, or the general
node type NODEpublic java.lang.String getAttributeValue(Name name)
getAttributeValue in interface NodeInfoname - the name of an attributepublic java.lang.String getAttributeValue(java.lang.String name)
getAttributeValue in interface NodeInfoname - the name of an attribute. This must be an unqualified attribute name,
i.e. one with no namespace prefix.public final ElementInfo getAncestor(Name name)
getAncestor in interface NodeInfoname - The name of the required ancestor.
public final NodeInfo getAncestor(Pattern pat,
Context c)
throws org.xml.sax.SAXException
getAncestor in interface NodeInfopattern - A pattern that the ancestor node must satisfy.public boolean isDocumentElement()
isDocumentElement in interface NodeInfopublic boolean isAncestor(NodeInfo other)
isAncestor in interface NodeInfoother - the other node (the putative descendant of this node)public org.w3c.dom.Element getDocumentElement()
getDocumentElement in interface NodeInfopublic DocumentInfo getDocumentRoot()
getDocumentRoot in interface NodeInfo
public final NodeInfo getNextSibling(Pattern pattern,
Context c)
throws org.xml.sax.SAXException
getNextSibling in interface NodeInfopattern - The match-pattern that the required sibling must matchpublic NodeInfo getNextInDocument(NodeInfo anchor)
getNextInDocument in interface NodeInfoanchor: - the scan stops when it reaches a node that is not a descendant of the specified
anchor node
public final NodeInfo getFirstChild(Pattern pattern,
Context c)
throws org.xml.sax.SAXException
getFirstChild in interface NodeInfopattern - the pattern to be matched
public final NodeInfo getPreviousSibling(Pattern pattern,
Context c)
throws org.xml.sax.SAXException
getPreviousSibling in interface NodeInfopattern - The match-pattern that the required sibling must match
public final NodeInfo getPreviousInDocument(Pattern pattern,
Context c)
throws org.xml.sax.SAXException
getPreviousInDocument in interface NodeInfopattern: - identifies a pattern the required node
public final NodeInfo getLastChild(Pattern pattern,
Context c)
throws org.xml.sax.SAXException
getLastChild in interface NodeInfopattern - the pattern to be matched
public void copyStringValue(Outputter out)
throws org.xml.sax.SAXException
copyStringValue in interface NodeInfopublic int getNumberSimple(Context context)
getNumberSimple in interface NodeInfocontext - Used for remembering previous result, for performancepublic int getNumberSimple()
getNumberSimple in interface NodeInfo
public int getNumberSingle(Pattern count,
Pattern from,
Context context)
throws org.xml.sax.SAXException
getNumberSingle in interface NodeInfocount - Pattern that identifies which nodes should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from - Pattern that specifies where counting starts from. Default (null) is the root node.
(This parameter does not seem useful but is included for the sake of XSLT conformance.)
public int getNumberAny(Pattern count,
Pattern from,
Context context)
throws org.xml.sax.SAXException
getNumberAny in interface NodeInfocount - Pattern that identifies which nodes should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from - Pattern that specifies where counting starts from. Default (null) is the root node.
Only nodes after the first (most recent) node that matches the 'from' pattern are counted.
public java.util.Vector getNumberMulti(Pattern count,
Pattern from,
Context context)
throws org.xml.sax.SAXException
getNumberMulti in interface NodeInfocount - Pattern that identifies which nodes (ancestors and their previous siblings)
should be counted. Default (null) is the element
name if the current node is an element, or "node()" otherwise.from - Pattern that specifies where counting starts from. Default (null) is the root node.
Only nodes below the first (most recent) node that matches the 'from' pattern are counted.protected static java.lang.String alphaKey(int value)
value - The positive integer key value (negative values are treated as zero).
public void removeNode()
throws org.xml.sax.SAXException
public static java.lang.String getNodeTypeName(int type)
public java.lang.String getNodeValue()
getNodeValue in interface org.w3c.dom.Node
public void setNodeValue(java.lang.String nodeValue)
throws org.w3c.dom.DOMException
setNodeValue in interface org.w3c.dom.Nodepublic org.w3c.dom.NodeList getChildNodes()
NodeList that contains all children of this node. If
there are no children, this is a NodeList containing no
nodes.getChildNodes in interface org.w3c.dom.Nodepublic org.w3c.dom.NamedNodeMap getAttributes()
NamedNodeMap containing the attributes of this node (if
it is an Element ) or null otherwise. (DOM method)getAttributes in interface org.w3c.dom.Nodepublic org.w3c.dom.Document getOwnerDocument()
Document object associated with this node. (DOM mehod)getOwnerDocument in interface org.w3c.dom.Node
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
throws org.w3c.dom.DOMException
newChild before the existing child node
refChild. DOM method: always fails.insertBefore in interface org.w3c.dom.NodenewChild - The node to insert.refChild - The reference node, i.e., the node before which the
new node must be inserted.org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Always raised.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
throws org.w3c.dom.DOMException
oldChild with
newChild in the list of children, and returns the
oldChild node. Always fails.replaceChild in interface org.w3c.dom.NodenewChild - The new node to put in the child list.oldChild - The node being replaced in the list.org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Always raised.
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
throws org.w3c.dom.DOMException
oldChild from the
list of children, and returns it. DOM method: always fails.removeChild in interface org.w3c.dom.NodeoldChild - The node being removed.org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Always raised.
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
throws org.w3c.dom.DOMException
newChild to the end of the list of children
of this node. DOM method: always fails.appendChild in interface org.w3c.dom.NodenewChild - The node to add.org.w3c.dom.DOMException - public boolean hasChildNodes()
hasChildNodes in interface org.w3c.dom.Nodetrue if the node has any children,
false if the node has no children.public org.w3c.dom.Node cloneNode(boolean deep)
cloneNode in interface org.w3c.dom.Nodedeep - If true , recursively clone the subtree under
the specified node; if false , clone only the node
itself (and its attributes, if it is an Element ).public void normalize()
Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes.normalize in interface org.w3c.dom.Node
public boolean supports(java.lang.String feature,
java.lang.String version)
feature - The name of the feature to test. This is the same name
which can be passed to the method hasFeature on
DOMImplementation .version - This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true .true if the specified feature is supported
on this node, false otherwise.
public void setPrefix(java.lang.String prefix)
throws org.w3c.dom.DOMException
setPrefix in interface org.w3c.dom.Node
protected void disallowUpdate()
throws org.w3c.dom.DOMException
public boolean hasAttributes()
hasAttributes in interface org.w3c.dom.Nodetrue if this node has any attributes,
false otherwise.
public boolean isSupported(java.lang.String feature,
java.lang.String version)
isSupported in interface org.w3c.dom.Nodefeature - The name of the feature to test (case-insensitive).version - This is the version number of the feature to test.true if the feature is implemented in the
specified version, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||