Class XPather


  • public class XPather
    extends java.lang.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

      Constructors 
      Constructor Description
      XPather​(java.lang.String expression)
      Constructor - creates XPather instance with specified XPath expression.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.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
    • Constructor Detail

      • XPather

        public XPather​(java.lang.String expression)
        Constructor - creates XPather instance with specified XPath expression.
        Parameters:
        expression -
    • Method Detail

      • evaluateAgainstNode

        public java.lang.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