org.exolab.adaptx.xml.dom2xpn

Class DocumentWrapperXPathNode

public class DocumentWrapperXPathNode extends ParentDOMXPathNode

An XPathNode wrapper for DOM Element nodes, used by the implementation of XPathNode for the W3C DOM API

Version: $Revision: 3830 $ $Date: 2003-09-09 00:44:41 -0400 (Tue, 09 Sep 2003) $

Author: Keith Visco

Constructor Summary
DocumentWrapperXPathNode(Document document)
Creates a new DocumentWrapperXPathNode
Method Summary
StringgetLocalName()
Returns the local name of the node.
StringgetNamespacePrefix(String uri)
Returns the namespace prefix associated with this namespace URI, as defined in the context of this node.
StringgetNamespaceURI()
Returns the namespace URI the node.
StringgetNamespaceURI(String prefix)
Returns the namespace URI associated with this namespace prefix, as defined in the context of this node.
intgetNodeType()
Returns the type of this node.
XPathNodegetRootNode()
Returns the root node.
StringgetStringValue()
Returns the string value of the node.

Constructor Detail

DocumentWrapperXPathNode

public DocumentWrapperXPathNode(Document document)
Creates a new DocumentWrapperXPathNode

Parameters: document the Document that this XPathNode wraps. This must not be null.

Method Detail

getLocalName

public String getLocalName()
Returns the local name of the node. Returns the local name of an element or attribute, the prefix of a namespace node, the target of a processing instruction, or null for all other node types.

Returns: The local name of the node, or null if the node has no name

getNamespacePrefix

public String getNamespacePrefix(String uri)
Returns the namespace prefix associated with this namespace URI, as defined in the context of this node. Returns null if no prefix is defined for this namespace URI. Returns an empty string if the default prefix is associated with this namespace URI. This method is valid only for element nodes.

Parameters: uri The namespace URI

Returns: The namespace prefix, or null

getNamespaceURI

public String getNamespaceURI()
Returns the namespace URI the node. Returns the namespace URI of an element, attribute or namespace node, or null for all other node types.

Returns: The namespace URI of the node, or null if the node has no namespace URI

getNamespaceURI

public String getNamespaceURI(String prefix)
Returns the namespace URI associated with this namespace prefix, as defined in the context of this node. Returns null if the prefix is undefined. Returns empty if the prefix is defined and associated with no namespace. This method is valid only for element nodes.

Parameters: prefix The namespace prefix

Returns: The namespace URI, or null

getNodeType

public int getNodeType()
Returns the type of this node.

Returns: The type of this node

getRootNode

public XPathNode getRootNode()
Returns the root node.

Returns: The root node

getStringValue

public String getStringValue()
Returns the string value of the node. The string value of a text node or an attribute node is it's text value. The string value of an element or a root node is the concatenation of the string value of all its child nodes. The string value of a namespace node is its namespace URI. The string value of a processing instruction is the instruction, and the string value of a comment is the comment text.

Returns: The string value of the node