Package org.apache.xpath.domapi

Examples of org.apache.xpath.domapi.XPathEvaluatorImpl


      * @return Value
      */
     public static String applyXPath(Document aDocument, String aXPathExpression)
     {
         // Create an XPath evaluator and pass in the document.
         XPathEvaluator tEvaluator = new XPathEvaluatorImpl(aDocument);
         //XPathNSResolver tResolver = tEvaluator.createNSResolver(aDocument);

         // Evaluate the xpath expression
         XPathResult tResult = (XPathResult)tEvaluator.evaluate(aXPathExpression,
                 aDocument, // contextNode
                 null/*tResolver*/, // support Namespace in XPath expressions
                 XPathResult.STRING_TYPE, // type of returned result
                 null); // construct a new result object (no reuse)

View Full Code Here


      // Use the DOM L3 XPath API to apply the xpath expression to the doc.
      System.out.println("Querying DOM using "+xpath);
     
      // Create an XPath evaluator and pass in the document.
      XPathEvaluator evaluator = new XPathEvaluatorImpl(doc);
      XPathNSResolver resolver = evaluator.createNSResolver(doc);
     
      // Evaluate the xpath expression
      XPathResult result = (XPathResult)evaluator.evaluate(xpath, doc, resolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
     

      // Serialize the found nodes to System.out.
      System.out.println("<output>");
                 
View Full Code Here

        Node contextNode,
        String xpath,
        Node namespaceNode)
        throws XPathException
    {
        XPathEvaluator evaluator = new XPathEvaluatorImpl();
        XPathNSResolver resolver = evaluator.createNSResolver(namespaceNode);

        return (XPathResult) evaluator.evaluate(
            xpath, contextNode, resolver,
            XPathResult.ANY_TYPE, null);
    }
View Full Code Here

      // Use the DOM L3 XPath API to apply the xpath expression to the doc.
      System.out.println("Querying DOM using "+xpath);
     
      // Create an XPath evaluator and pass in the document.
      XPathEvaluator evaluator = new XPathEvaluatorImpl(doc);
      XPathNSResolver resolver = evaluator.createNSResolver(doc);
     
      // Evaluate the xpath expression
      XPathResult result = (XPathResult)evaluator.evaluate(xpath, doc, resolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
     

      // Serialize the found nodes to System.out.
      System.out.println("<output>");
                 
View Full Code Here

      // Use the DOM L3 XPath API to apply the xpath expression to the doc.
      System.out.println("Querying DOM using "+xpath);
     
      // Create an XPath evaluator and pass in the document.
      XPathEvaluator evaluator = new XPathEvaluatorImpl(doc);
      XPathNSResolver resolver = evaluator.createNSResolver(doc);
     
      // Evaluate the xpath expression
      XPathResult result = (XPathResult)evaluator.evaluate(xpath, doc, resolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
     

      // Serialize the found nodes to System.out.
      System.out.println("<output>");
                 
View Full Code Here

      // Use the DOM L3 XPath API to apply the xpath expression to the doc.
      System.out.println("Querying DOM using "+xpath);
     
      // Create an XPath evaluator and pass in the document.
      XPathEvaluator evaluator = new XPathEvaluatorImpl(doc);
      XPathNSResolver resolver = evaluator.createNSResolver(doc);
     
      // Evaluate the xpath expression
      XPathResult result = (XPathResult)evaluator.evaluate(xpath, doc, resolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
     

      // Serialize the found nodes to System.out.
      System.out.println("<output>");
                 
View Full Code Here

      // Use the DOM L3 XPath API to apply the xpath expression to the doc.
      System.out.println("Querying DOM using "+xpath);
     
      // Create an XPath evaluator and pass in the document.
      XPathEvaluator evaluator = new XPathEvaluatorImpl(doc);
      XPathNSResolver resolver = evaluator.createNSResolver(doc);
     
      // Evaluate the xpath expression
      XPathResult result = (XPathResult)evaluator.evaluate(xpath, doc, resolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
     

      // Serialize the found nodes to System.out.
      System.out.println("<output>");
                 
View Full Code Here

        Node contextNode,
        String xpath,
        Node namespaceNode)
        throws XPathException
    {
        XPathEvaluator evaluator = new XPathEvaluatorImpl();
        XPathNSResolver resolver = evaluator.createNSResolver(namespaceNode);

        return (XPathResult) evaluator.evaluate(
            xpath, contextNode, resolver,
            XPathResult.ANY_TYPE, null);
    }
View Full Code Here

TOP

Related Classes of org.apache.xpath.domapi.XPathEvaluatorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.