org.openprivacy.reptile.xml
Class ReptileXPath

java.lang.Object
  |
  +--org.openprivacy.reptile.xml.ReptileXPath

public class ReptileXPath
extends java.lang.Object

Used to abstract the use of Jaxen XPath. Internally this can use whatever parser we want, DOM4J, JDOM, DOM, whatever.

Version:
$Id: ReptileXPath.java,v 1.4 2002/02/08 01:05:52 burton Exp $
Author:
burtonator

Constructor Summary
ReptileXPath(java.lang.String content, java.lang.String xpath_expression)
          Create a new ReptileXPath instance.
 
Method Summary
 void addNamespace(java.lang.String prefix, java.lang.String uri)
           
static void assertXPath(java.lang.String content, java.lang.String expression, java.lang.String value)
          Assert that the given expression, in the given content, equals the given value.
static void assertXPathNodes(java.lang.String content, java.lang.String expression)
          Assert that the given expression, in the given content, equals the given value.
static void assertXPathNotEqual(java.lang.String content, java.lang.String expression, java.lang.String value)
          Assert that the given expression, in the given content, equals the given value.
 java.util.List selectNodes()
          Select a multiple nodes with this expression.
 java.lang.Object selectSingleNode()
          Select a single node with this expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReptileXPath

public ReptileXPath(java.lang.String content,
                    java.lang.String xpath_expression)
             throws java.lang.Exception
Create a new ReptileXPath instance.

Method Detail

selectNodes

public java.util.List selectNodes()
                           throws java.lang.Exception
Select a multiple nodes with this expression.

java.lang.Exception

selectSingleNode

public java.lang.Object selectSingleNode()
                                  throws java.lang.Exception
Select a single node with this expression. What type of object that this returns may change depending on your XPath query. If it is an element query it will return an JDOM Element. If it is an attribute query it will return a JDOM Attribute.

java.lang.Exception

addNamespace

public void addNamespace(java.lang.String prefix,
                         java.lang.String uri)
                  throws java.lang.Exception
java.lang.Exception
See Also:
BaseXPath.addNamespace(java.lang.String, java.lang.String)

assertXPathNodes

public static void assertXPathNodes(java.lang.String content,
                                    java.lang.String expression)
                             throws java.lang.Exception
Assert that the given expression, in the given content, equals the given value. Internally this uses selectSingleNode.

java.lang.Exception

assertXPath

public static void assertXPath(java.lang.String content,
                               java.lang.String expression,
                               java.lang.String value)
                        throws java.lang.Exception
Assert that the given expression, in the given content, equals the given value. Internally this uses selectSingleNode.

java.lang.Exception

assertXPathNotEqual

public static void assertXPathNotEqual(java.lang.String content,
                                       java.lang.String expression,
                                       java.lang.String value)
                                throws java.lang.Exception
Assert that the given expression, in the given content, equals the given value. Internally this uses selectSingleNode.

java.lang.Exception