com.hp.hpl.sparta.xpath
Class XPath

java.lang.Object
  |
  +--com.hp.hpl.sparta.xpath.XPath

public class XPath
extends java.lang.Object

The root of the parse tree for an XPath expression. This is a participant in the Visitor Pattern [Gamma et al, #331]. You create an XPath object (which parses an XPath expression into a parse tree), create a Vistor object, and pass the visitor to the XPath.accept method.

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:02 $ $Revision: 1.1.1.1 $
Author:
Eamonn O'Brien-Strain

Method Summary
static XPath get(java.lang.String xpathString)
          Return the xpath parse-tree object for this expression.
 java.lang.String getIndexingAttrName()
          Return the attribute name in a trailing [@attrName] predicate.
 java.util.Enumeration getSteps()
           
 boolean isAbsolute()
          Does this path begin with a '/' or '//' ?
 boolean isStringValue()
          Does xpath evaluate to a string values (attribute values or text() nodes)
static boolean isStringValue(java.lang.String xpathString)
          Convenience function equivalent to get(xpathString).isStringValue()
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

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

isAbsolute

public boolean isAbsolute()
Does this path begin with a '/' or '//' ?

isStringValue

public boolean isStringValue()
Does xpath evaluate to a string values (attribute values or text() nodes)

getSteps

public java.util.Enumeration getSteps()

getIndexingAttrName

public java.lang.String getIndexingAttrName()
                                     throws XPathException
Return the attribute name in a trailing [@attrName] predicate. For example if the Xpath expression was "/a/b[@p='pp']/c[@q]" then the indexing attribute name would be "q"

get

public static XPath get(java.lang.String xpathString)
                 throws XPathException
Return the xpath parse-tree object for this expression. This may be either a newly created object or a cached copy.

isStringValue

public static boolean isStringValue(java.lang.String xpathString)
                             throws XPathException,
                                    java.io.IOException
Convenience function equivalent to get(xpathString).isStringValue()