com.hp.hpl.thermopylae.fatpath
Class XPathAPI

java.lang.Object
  |
  +--com.hp.hpl.thermopylae.fatpath.XPathAPI

public class XPathAPI
extends java.lang.Object

Facade class providing a convenient API to the XPath parser and evaluator. For efficiency, parsed XPath expressions are cached. For ease of migration from Xalan XPath this class has the same name and has the same method names as the Xalan XPathAPI class. See Facade Pattern

Copyright (C) 2002 Hewlett-Packard Company. This file is part of Sparta, an XML Parser, DOM, and XPath library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Version:
$Date: 2002/08/19 05:04:23 $ $Revision: 1.1.1.1 $
Author:
Eamonn O'Brien-Strain
See Also:
org.apache.xpath.XPathAPI

Constructor Summary
XPathAPI()
           
 
Method Summary
static java.util.Enumeration selectElementIterator(org.w3c.dom.Document doc, java.lang.String xpathString)
           
static java.util.Enumeration selectElementIterator(org.w3c.dom.Element element, java.lang.String xpathString)
           
static org.w3c.dom.Element selectSingleElement(org.w3c.dom.Document doc, java.lang.String xpathString)
           
static org.w3c.dom.Element selectSingleElement(org.w3c.dom.Element element, java.lang.String xpathString)
           
static java.lang.String selectSingleString(org.w3c.dom.Document doc, java.lang.String xpathString)
           
static java.lang.String selectSingleString(org.w3c.dom.Element element, java.lang.String xpathString)
           
static java.util.Enumeration selectStringIterator(org.w3c.dom.Document doc, java.lang.String xpathString)
           
static java.util.Enumeration selectStringIterator(org.w3c.dom.Element element, java.lang.String xpathString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathAPI

public XPathAPI()
Method Detail

selectElementIterator

public static java.util.Enumeration selectElementIterator(org.w3c.dom.Element element,
                                                          java.lang.String xpathString)
                                                   throws XPathException,
                                                          java.io.IOException
Returns:
all the elements that match the relative XPath expression with respect to the context element.

selectStringIterator

public static java.util.Enumeration selectStringIterator(org.w3c.dom.Element element,
                                                         java.lang.String xpathString)
                                                  throws XPathException,
                                                         java.io.IOException
Returns:
all the strings that match the relative XPath expression with respect to the context element.

selectElementIterator

public static java.util.Enumeration selectElementIterator(org.w3c.dom.Document doc,
                                                          java.lang.String xpathString)
                                                   throws XPathException,
                                                          java.io.IOException
Returns:
all the elements in the document that match the absolute XPath expression.

selectStringIterator

public static java.util.Enumeration selectStringIterator(org.w3c.dom.Document doc,
                                                         java.lang.String xpathString)
                                                  throws XPathException,
                                                         java.io.IOException
Returns:
all the strings in the document that match the absolute XPath expression.

selectSingleElement

public static org.w3c.dom.Element selectSingleElement(org.w3c.dom.Element element,
                                                      java.lang.String xpathString)
                                               throws XPathException,
                                                      java.io.IOException
Returns:
the first element that matches the relative XPath expression with respect to the context element, or null if there is no match.

selectSingleElement

public static org.w3c.dom.Element selectSingleElement(org.w3c.dom.Document doc,
                                                      java.lang.String xpathString)
                                               throws XPathException,
                                                      java.io.IOException
Returns:
the first element in this document that matches the absolute XPath expression, or null if there is no match.

selectSingleString

public static java.lang.String selectSingleString(org.w3c.dom.Element element,
                                                  java.lang.String xpathString)
                                           throws XPathException,
                                                  java.io.IOException
Returns:
the first element that matches the relative XPath expression with respect to the context element, or null if there is no match.

selectSingleString

public static java.lang.String selectSingleString(org.w3c.dom.Document doc,
                                                  java.lang.String xpathString)
                                           throws XPathException,
                                                  java.io.IOException
Returns:
the first string in this document that matches the absolute XPath expression, or null if there is no match.