Class XPath

java.lang.Object
  extended by XPath

public class XPath
extends java.lang.Object

Encapsulates the compilation and matching of an XPath expression Deals internally with exceptions that can be raised at compilation and evaluation


Field Summary
private  java.lang.String expr
           
private  java.lang.String xPathProvider
           
private  javax.xml.xpath.XPathExpression xpexpr
           
 
Constructor Summary
XPath(java.lang.String expr, NamespaceContext context)
          Compile the XPath expression
 
Method Summary
 java.lang.String getXPathProvider()
          Return the name of the XPath processor
static void main(java.lang.String[] args)
          For Unit Testing
 org.w3c.dom.NodeList matches(org.w3c.dom.Node node)
          Check if the XPath matches the node and returns the NodeList of the matching
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xpexpr

private javax.xml.xpath.XPathExpression xpexpr

expr

private java.lang.String expr

xPathProvider

private java.lang.String xPathProvider
Constructor Detail

XPath

XPath(java.lang.String expr,
      NamespaceContext context)
throws javax.xml.xpath.XPathFactoryConfigurationException
Compile the XPath expression

Parameters:
expr - String containing the XPath expression to compile
context - Namespace context of the expression
Throws:
javax.xml.xpath.XPathFactoryConfigurationException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getXPathProvider

public java.lang.String getXPathProvider()
Return the name of the XPath processor

Returns:

matches

public org.w3c.dom.NodeList matches(org.w3c.dom.Node node)
Check if the XPath matches the node and returns the NodeList of the matching

Parameters:
node - starting node
Returns:
list of nodes matching the current XPath

main

public static void main(java.lang.String[] args)
For Unit Testing

Parameters:
args -