Examples of XPathEvaluator


Examples of org.w3c.dom.xpath.XPathEvaluator

      // 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

Examples of org.w3c.dom.xpath.XPathEvaluator

             * provide one for us, which means prefixes will not be resolved
             * in the query (Xalan will just throw an error if a prefix
             * is used).  In the future we may want to revisit this
             * to make it easier for users to query based on namespaces.
             */
            XPathEvaluator eval = (XPathEvaluator)
                dBuilder.getDOMImplementation().getFeature("+XPath", "3.0");
            query = eval.createExpression(queryExpr, null);

            this.queryExpr = queryExpr;
            this.opName = opName;
            this.recompileQuery = false;

View Full Code Here

Examples of us.codecraft.xsoup.XPathEvaluator

        }
        System.out.println(System.currentTimeMillis()-time);

        System.out.println("=============");

        XPathEvaluator compile = Xsoup.compile("//a");
        time =System.currentTimeMillis();
        for (int i = 0; i < 2000; i++) {
            compile.evaluate(document);
        }
        System.out.println(System.currentTimeMillis()-time);

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.