|
|||||||||
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 static SingletonEnumeration |
emptyEnumeration
|
protected int |
index
|
protected com.icl.saxon.tree.ParentNodeImpl |
parent
|
Fields inherited from interface com.icl.saxon.om.NodeInfo |
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NODE_TYPE_NAMES, NONE, NUMBER_OF_TYPES, PI, ROOT, 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,
int nsCode,
int index)
Construct a Namespace node |
Method Summary | |
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 |
NodeEnumeration |
enumerateChildren()
Get an enumeration of the children of this node |
NodeInfo[] |
getAllChildNodes()
Get all child nodes of the node - default implementation used for leaf nodes |
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(int fingerprint)
Get 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. |
java.lang.String |
getAttributeValue(java.lang.String uri,
java.lang.String localName)
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. |
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 |
int |
getFingerprint()
Get the fingerprint of the node. |
org.w3c.dom.Node |
getFirstChild()
Get first child - default implementation used for leaf nodes |
int |
getIndex()
Get the index of this node, i.e. |
org.w3c.dom.Node |
getLastChild()
Get last child - default implementation used for leaf nodes |
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. |
int |
getNameCode()
Get the namecode for this name. |
NamePool |
getNamePool()
Get the NamePool |
int |
getNamespaceCode()
Get the namespace code for this prefix/uri pair. |
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 |
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. |
java.lang.String |
getNodeValue()
Get the node value as defined in the DOM. |
int |
getNumberOfChildren()
Get the number of children. |
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. |
org.w3c.dom.Node |
getPreviousSibling()
Get previous sibling - not defined for namespace nodes |
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. |
short |
getURICode()
Get URI code. |
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. |
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 |
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)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
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 |
setNamespaceCode(int nsCode)
Change the uri of the namespace that this node relates to (used to implement xsl:namespace-alias) |
void |
setNodeValue(java.lang.String nodeValue)
Set the node value. |
void |
setPrefix(java.lang.String prefix)
Set the namespace prefix of 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, enumerateChildren, getAllChildNodes, getAttributeValue, getAttributeValue, getAttributeValue, getDisplayName, getDocumentElement, getDocumentRoot, getFingerprint, getIndex, getLineNumber, getLocalName, getNextInDocument, getNumberOfChildren, getPrefix, getSystemId, getURI, getURICode, 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 static SingletonEnumeration emptyEnumeration
protected com.icl.saxon.tree.ParentNodeImpl parent
protected int index
Constructor Detail |
public NamespaceImpl(ElementImpl element, int nsCode, int index) throws org.xml.sax.SAXException
element
- The element owning the namespace nodensCode
- The namespace codeindex
- Integer identifying this namespace node among the nodes for its parentMethod Detail |
public int getNameCode()
getNameCode
in interface NodeInfo
getNameCode
in class com.icl.saxon.tree.NodeImpl
public int getNamespaceCode()
getNamespaceCode
in interface NamespaceInfo
public boolean isSameNode(NodeInfo other)
isSameNode
in interface NodeInfo
isSameNode
in class com.icl.saxon.tree.NodeImpl
public java.lang.String getNamespacePrefix()
getNamespacePrefix
in interface NamespaceInfo
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface NamespaceInfo
getNamespaceURI
in class com.icl.saxon.tree.NodeImpl
public void setNamespaceCode(int nsCode)
public final short getNodeType()
getNodeType
in interface NodeInfo
public java.lang.String getValue()
getValue
in interface NodeInfo
public java.lang.String getNodeName()
getNodeName
in interface NodeInfo
getNodeName
in class com.icl.saxon.tree.NodeImpl
public org.w3c.dom.Node getNextSibling()
getNextSibling
in interface org.w3c.dom.Node
getNextSibling
in class com.icl.saxon.tree.NodeImpl
com.icl.saxon.tree.NodeImpl
public org.w3c.dom.Node getPreviousSibling()
getPreviousSibling
in interface org.w3c.dom.Node
getPreviousSibling
in class com.icl.saxon.tree.NodeImpl
com.icl.saxon.tree.NodeImpl
public NodeInfo getPreviousInDocument()
getPreviousInDocument
in interface NodeInfo
getPreviousInDocument
in class com.icl.saxon.tree.NodeImpl
com.icl.saxon.om.NodeInfo
public NodeInfo getNextInDocument()
SAXException,
- alwayspublic java.lang.String getSequentialKey()
getSequentialKey
in interface NodeInfo
getSequentialKey
in class com.icl.saxon.tree.NodeImpl
com.icl.saxon.om.NodeInfo
public void copy(Outputter out) throws org.xml.sax.SAXException
copy
in interface NodeInfo
public void defaultAction(Context c)
defaultAction
in interface NodeInfo
public long getSequenceNumber()
getSequenceNumber
in interface NodeInfo
getSequenceNumber
in class com.icl.saxon.tree.NodeImpl
public java.lang.String getPath()
getPath
in interface NodeInfo
public java.lang.String toString()
toString
in class com.icl.saxon.tree.NodeImpl
public int getFingerprint()
getFingerprint
in interface NodeInfo
public java.lang.String getSystemId()
getSystemId
in interface NodeInfo
com.icl.saxon.om.NodeInfo
public NamePool getNamePool()
public java.lang.String getPrefix()
getPrefix
in interface NodeInfo
public java.lang.String getURI()
getURI
in interface NodeInfo
public short getURICode()
getURICode
in interface NodeInfo
public java.lang.String getDisplayName()
getDisplayName
in interface NodeInfo
public java.lang.String getLocalName()
getLocalName
in interface NodeInfo
public int getLineNumber()
getLineNumber
in interface NodeInfo
com.icl.saxon.om.NodeInfo
public java.lang.String getPublicId()
public final int getIndex()
getIndex
in interface NodeInfo
com.icl.saxon.om.NodeInfo
public final org.w3c.dom.Node getParentNode()
getParentNode
in interface org.w3c.dom.Node
public org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
public org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
public int getNumberOfChildren()
getNumberOfChildren
in interface NodeInfo
public NodeInfo[] getAllChildNodes()
getAllChildNodes
in interface NodeInfo
public NodeEnumeration enumerateChildren()
enumerateChildren
in interface NodeInfo
public 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.
nodeType
- One of the specific node types such as ELEMENT or TEXT, or the general
node type NODEpublic boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
true
if this node has any attributes,
false
otherwise.public java.lang.String getAttributeValue(java.lang.String uri, java.lang.String localName)
getAttributeValue
in interface NodeInfo
uri
- the namespace uri of an attributelocalName
- the local name of an attributepublic java.lang.String getAttributeValue(java.lang.String name)
getAttributeValue
in interface NodeInfo
name
- the name of an attribute. This must be an unqualified attribute name,
i.e. one with no namespace prefix.public java.lang.String getAttributeValue(int fingerprint)
getAttributeValue
in interface NodeInfo
fingerprint
- The fingerprint of the attribute namepublic boolean isDocumentElement()
isDocumentElement
in interface NodeInfo
public org.w3c.dom.Element getDocumentElement()
getDocumentElement
in interface NodeInfo
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
public NodeInfo getNextInDocument(NodeInfo anchor)
getNextInDocument
in interface NodeInfo
anchor:
- the scan stops when it reaches a node that is not a descendant of the specified
anchor nodepublic void copyStringValue(Outputter out) throws org.xml.sax.SAXException
copyStringValue
in interface NodeInfo
public void removeNode() throws org.xml.sax.SAXException
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.Node
public 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.Node
public 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.Node
public 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.Node
newChild
- 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.Node
newChild
- 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.Node
oldChild
- 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.Node
newChild
- The node to add.org.w3c.dom.DOMException
- public boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
true
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.Node
deep
- 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 isSupported(java.lang.String feature, java.lang.String version)
isSupported
in interface org.w3c.dom.Node
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |