Package org.jaxen

Examples of org.jaxen.BaseXPath.selectNodes()


        String url = TESTS_ROOT + "xml/nitf.xml";
        log("Document [" + url + "]");
        Object document = nav.getDocument(url);
        XPath contextpath = new BaseXPath("/", nav);
        log("Initial Context :: " + contextpath);
        List list = contextpath.selectNodes(document);
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            Object context = iter.next();
            assertCountXPath(1, context, "/nitf/head/meta[@name='ap-cycle']");
            assertCountXPath(1, context, "/nitf/head/meta[@content='AP']");
View Full Code Here


        String url = TESTS_ROOT + "xml/moreover.xml";
        log("Document [" + url + "]");
        Object document = nav.getDocument(url);
        XPath contextpath = new BaseXPath("/", nav);
        log("Initial Context :: " + contextpath);
        List list = contextpath.selectNodes(document);
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            Object context = iter.next();
            assertCountXPath(1, context, "/child::node()");
            assertCountXPath(1, context, "/*");
 
View Full Code Here

            assertCountXPath(20, context, "/*/*[@code]");
            assertCountXPath(1, context, "/moreovernews/article[@code='13563275']");
            try {
                BaseXPath xpath =
                        new BaseXPath("/moreovernews/article[@code='13563275']", getNavigator());
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
View Full Code Here

            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
            }
            try {
                BaseXPath xpath = new BaseXPath("/*/article[@code='13563275']", getNavigator());
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
View Full Code Here

            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
            }
            try {
                BaseXPath xpath = new BaseXPath("//article[@code='13563275']", getNavigator());
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
View Full Code Here

            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
            }
            try {
                BaseXPath xpath = new BaseXPath("//*[@code='13563275']", getNavigator());
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
View Full Code Here

                log(debug, "      ## SKIPPED -- Unsupported Axis");
            }
            try {
                BaseXPath xpath = new BaseXPath("/child::node()/child::node()[@code='13563275']",
                                                getNavigator());
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
View Full Code Here

            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
            }
            try {
                BaseXPath xpath = new BaseXPath("/*/*[@code='13563275']", getNavigator());
                List results = xpath.selectNodes(getContext(context));
                Object result = results.get(0);
                assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
            }
            catch (UnsupportedAxisException e) {
                log(debug, "      ## SKIPPED -- Unsupported Axis");
View Full Code Here

        String url = TESTS_ROOT + "xml/contents.xml";
        log("Document [" + url + "]");
        Object document = nav.getDocument(url);
        XPath contextpath = new BaseXPath("/", nav);
        log("Initial Context :: " + contextpath);
        List list = contextpath.selectNodes(document);
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            Object context = iter.next();
            assertCountXPath(3, context, "processing-instruction()");
            assertCountXPath(3, context, "/processing-instruction()");
View Full Code Here

        String url = TESTS_ROOT + "xml/fibo.xml";
        log("Document [" + url + "]");
        Object document = nav.getDocument(url);
        XPath contextpath = new BaseXPath("/", nav);
        log("Initial Context :: " + contextpath);
        List list = contextpath.selectNodes(document);
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            Object context = iter.next();
            assertCountXPath(9, context, "/*/fibonacci[position() < 10]");
            assertValueOfXPath("196417", context, "sum(//fibonacci)");
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.