dk.brics.xpath.converter
Class XPathParser

java.lang.Object
  extended by dk.brics.xpath.converter.XPathParser

public class XPathParser
extends Object

Parser for XPath paths.


Constructor Summary
XPathParser()
          Constructs a new XPath parser.
 
Method Summary
 Path parse(String str)
          Parses a given XPath path.
 UnionExpr parseUnion(String str)
          Parses a given XPath path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathParser

public XPathParser()
Constructs a new XPath parser.

Method Detail

parse

public Path parse(String str)
           throws XPathException
Parses a given XPath path.

Note: If the expression contains top-level unions only the first path will be returned. Use parseUnion(String) to support more general XPath expressions.

Parameters:
str - a string representation of an XPath path
Returns:
the Path representation of str
Throws:
XPathException - if parse error

parseUnion

public UnionExpr parseUnion(String str)
                     throws XPathException
Parses a given XPath path.

Parameters:
str - a string representation of an XPath path
Returns:
the UnionExpr representation of str
Throws:
XPathException - if parse error


Copyright © 2005-2010 Anders Møller.