Package org.jaxen.dom

Examples of org.jaxen.dom.DOMXPath.selectNodes()


        {
            Map.Entry entry = (Map.Entry) itr.next();
            xpath.addNamespace((String) entry.getKey(), (String) entry.getValue());
        }
       
        return xpath.selectNodes(node);
    }
   
    protected Object selectNode(Node node, String path) throws JaxenException
    {
        List nodes = selectNodes(node, path);
View Full Code Here


    String namespaceXPathString = "//namespace::node()";

    try
    {
      XPath xpath = new DOMXPath(namespaceXPathString);
      nlist = xpath.selectNodes(contextNode);
     
            for (int i = 0; i < nlist.size(); i++)
            {
                Node node = (Node)nlist.get(i);
                if(node.getParentNode() != null && node.getParentNode().getPrefix() != null)
View Full Code Here

    private Object assertCountXPath2(int expectedSize, Object context, String xpathStr) throws JaxenException
    {
        log(debug,
                "  Select :: " + xpathStr);
        DOMXPath xpath = new DOMXPath(xpathStr);
        List results = xpath.selectNodes(getContext(context));
        log(debug,
                "    Expected Size :: " + expectedSize);
        log(debug,
                "    Result Size   :: " + results.size());
        if (expectedSize != results.size())
View Full Code Here

        try
        {
            log(debug,
                    "  Select :: " + xpathStr);
            DOMXPath xpath = new DOMXPath(xpathStr);
            List results = xpath.selectNodes(getContext(context));
            log(debug,
                    "    Result Size   :: " + results.size());
            fail("An exception was expected.");
        }
        catch (JaxenException e)
View Full Code Here

            assertCountXPath(20, context, "//*[local-name()='article']");
            assertCountXPath(20, context, "//article");
            assertCountXPath(20, context, "/*/*[@code]");
            assertCountXPath(1, context, "/moreovernews/article[@code='13563275']");
                DOMXPath xpath = new DOMXPath("/moreovernews/article[@code='13563275']");
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("/*/article[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
View Full Code Here

                DOMXPath xpath = new DOMXPath("/moreovernews/article[@code='13563275']");
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("/*/article[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("//article[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
View Full Code Here

            xpath = new DOMXPath("/*/article[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("//article[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("//*[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
View Full Code Here

            xpath = new DOMXPath("//article[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("//*[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("/child::node()/child::node()[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
View Full Code Here

            xpath = new DOMXPath("//*[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("/child::node()/child::node()[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("/*/*[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
View Full Code Here

            xpath = new DOMXPath("/child::node()/child::node()[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            xpath = new DOMXPath("/*/*[@code='13563275']");
            results = xpath.selectNodes(getContext(context));
            result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            }

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.