Class CSS2XPath

java.lang.Object
org.joox.selector.CSS2XPath

public final class CSS2XPath extends Object
A utility class converting CSS selector expressions to XPath expressions.

This class is a facade for the more extensive functionality provided by the css-selectors project created by Christer Sandberg. jOOX does not expose that functionality publicly.

See Also:
  • Field Details

    • SIMPLE_SELECTOR

      private static final Pattern SIMPLE_SELECTOR
      A selector pattern that can be evaluated using standard DOM API
  • Constructor Details

    • CSS2XPath

      public CSS2XPath()
  • Method Details

    • css2xpath

      public static final String css2xpath(String css)
      Convert a CSS selector expression to an XPath expression
    • css2xpath

      public static final String css2xpath(String css, boolean isRoot)
      Convert a CSS selector expression to an XPath expression
    • endsWith

      private static void endsWith(StringBuilder sb, String attr, String value)
      XPath 2.0

      ends-with($str1, $str2)

      is equivalent to XPath 1.0

      $str2 = substring($str1, string-length($str1) - string-length($str2) + 1)