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])
Constructor Summary |
XPather(String expression)
Constructor - creates XPather instance with specified XPath expression. |
Method Summary |
Object[] |
evaluateAgainstNode(TagNode node)
Main public method for this class - a way to execute XPath expression against
specified TagNode instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPather
public XPather(String expression)
- Constructor - creates XPather instance with specified XPath expression.
- Parameters:
expression
-
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
Copyright © 2006-2014. All Rights Reserved.