Package org.htmlcleaner
Class XPather
- java.lang.Object
-
- org.htmlcleaner.XPather
-
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])
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
evaluateAgainstNode(TagNode node)
Main public method for this class - a way to execute XPath expression against specified TagNode instance.
-
-
-
Constructor Detail
-
XPather
public XPather(String expression)
Constructor - creates XPather instance with specified XPath expression.- Parameters:
expression
-
-
-
Method Detail
-
evaluateAgainstNode
public Object[] evaluateAgainstNode(TagNode node) throws XPatherException
Main public method for this class - a way to execute XPath expression against specified TagNode instance.- Parameters:
node
-- Throws:
XPatherException
-
-