public class XPather extends Object
Utility for searching cleaned document tree with XPath expressions.
Examples of supported axes:
- //div//a
- //div//a[@id][@class]
- /body/*[1]/@type
- //div[3]//a[@id][@href='r/n4']
- //div[last() >= 4]//./div[position() = last()])[position() > 22]//li[2]//a
- //div[2]/@*[2]
- data(//div//a[@id][@class])
- //p/last()
- //body//div[3][@class]//span[12.2
- data(//a['v' < @id])
Constructor and Description |
---|
XPather(String expression)
Constructor - creates XPather instance with specified XPath expression.
|
Modifier and Type | Method and Description |
---|---|
Object[] |
evaluateAgainstNode(TagNode node)
Main public method for this class - a way to execute XPath expression against
specified TagNode instance.
|
public XPather(String expression)
expression
- public Object[] evaluateAgainstNode(TagNode node) throws XPatherException
node
- XPatherException
Copyright © 2006–2017. All rights reserved.