Package play.libs

Class XPath

java.lang.Object
play.libs.XPath

public class XPath extends Object
XPath for parsing
  • Constructor Details

    • XPath

      public XPath()
  • Method Details

    • selectNodes

      public static NodeList selectNodes(String path, Object node, Map<String,String> namespaces)
      Select all nodes that are selected by this XPath expression. If multiple nodes match, multiple nodes will be returned. Nodes will be returned in document-order,
      Parameters:
      path - the xpath expression
      node - the starting node
      namespaces - Namespaces that need to be available in the xpath, where the key is the prefix and the value the namespace URI
      Returns:
      result of evaluating the xpath expression against node
    • selectNodes

      public static NodeList selectNodes(String path, Object node)
      Select all nodes that are selected by this XPath expression. If multiple nodes match, multiple nodes will be returned. Nodes will be returned in document-order,
      Parameters:
      path - the xpath expression
      node - the starting node
      Returns:
      result of evaluating the xpath expression against node
    • selectNode

      public static Node selectNode(String path, Object node, Map<String,String> namespaces)
    • selectNode

      public static Node selectNode(String path, Object node)
    • selectText

      public static String selectText(String path, Object node, Map<String,String> namespaces)
      Parameters:
      path - the XPath to execute
      node - the node, node-set or Context object for evaluation. This value can be null.
      namespaces - the XML namespaces map
      Returns:
      the text of a node, or the value of an attribute
    • selectText

      public static String selectText(String path, Object node)
      Parameters:
      path - the XPath to execute
      node - the node, node-set or Context object for evaluation. This value can be null.
      Returns:
      the text of a node, or the value of an attribute