Interface XPathEngine

  • All Known Implementing Classes:
    JAXPXPathEngine

    public interface XPathEngine
    Interface for XMLUnit's XPath abstraction.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String evaluate​(java.lang.String xPath, javax.xml.transform.Source s)
      Evaluates an XPath expression and stringifies the result.
      java.lang.String evaluate​(java.lang.String xPath, org.w3c.dom.Node n)
      Evaluates an XPath expression and stringifies the result.
      java.lang.Iterable<org.w3c.dom.Node> selectNodes​(java.lang.String xPath, javax.xml.transform.Source s)
      Returns a potentially empty collection of Nodes matching an XPath expression.
      java.lang.Iterable<org.w3c.dom.Node> selectNodes​(java.lang.String xPath, org.w3c.dom.Node n)
      Returns a potentially empty collection of Nodes matching an XPath expression.
      void setNamespaceContext​(java.util.Map<java.lang.String,​java.lang.String> prefix2Uri)
      Establish a namespace context.
    • Method Detail

      • selectNodes

        java.lang.Iterable<org.w3c.dom.Node> selectNodes​(java.lang.String xPath,
                                                         javax.xml.transform.Source s)
        Returns a potentially empty collection of Nodes matching an XPath expression.
        Parameters:
        xPath - the XPath expression
        s - the XML source to apply the expression to
        Returns:
        matching nodes
      • evaluate

        java.lang.String evaluate​(java.lang.String xPath,
                                  javax.xml.transform.Source s)
        Evaluates an XPath expression and stringifies the result.
        Parameters:
        xPath - the XPath expression
        s - the XML source to apply the expression to
        Returns:
        stringified result
      • selectNodes

        java.lang.Iterable<org.w3c.dom.Node> selectNodes​(java.lang.String xPath,
                                                         org.w3c.dom.Node n)
        Returns a potentially empty collection of Nodes matching an XPath expression.
        Parameters:
        xPath - the XPath expression
        n - the XML source to apply the expression to
        Returns:
        matching nodes
      • evaluate

        java.lang.String evaluate​(java.lang.String xPath,
                                  org.w3c.dom.Node n)
        Evaluates an XPath expression and stringifies the result.
        Parameters:
        xPath - the XPath expression
        n - the XML source to apply the expression to
        Returns:
        stringified result
      • setNamespaceContext

        void setNamespaceContext​(java.util.Map<java.lang.String,​java.lang.String> prefix2Uri)
        Establish a namespace context.
        Parameters:
        prefix2Uri - maps from prefix to namespace URI.