Package org.jaxen.dom4j

Examples of org.jaxen.dom4j.Dom4jXPath.selectNodes()


           
            Document doc = reader.read( args[0] );
           
            XPath xpath = new Dom4jXPath( args[1] );
           
            List results = xpath.selectNodes( doc );

            Iterator resultIter = results.iterator();
           
            System.out.println("Document :: " + args[0] );
            System.out.println("   XPath :: " + args[1] );
View Full Code Here


           
            Document doc = reader.read( args[0] );
           
            XPath xpath = new Dom4jXPath( args[1] );
           
            List results = xpath.selectNodes( doc );

            Iterator resultIter = results.iterator();
           
            System.out.println("Document :: " + args[0] );
            System.out.println("   XPath :: " + args[1] );
View Full Code Here

               
                try {
                  XPath xpathURL = new Dom4jXPath("/pmh:OAI-PMH/pmh:ListRecords/pmh:record/pmh:metadata/xb:digital_entity/pmh:urls/pmh:url[@type='stream']");
                  xpathURL.setNamespaceContext(new SimpleNamespaceContext(map));
           
            List urlList = xpathURL.selectNodes(list.getResponse());
            for (Object aNode : urlList) {
              try {
                if (aNode instanceof Node) {
                  resultList.add(new URI(((Node) aNode).getText()));
                }
View Full Code Here

           
            Document doc = reader.read( args[0] );
           
            XPath xpath = new Dom4jXPath( args[1] );
           
            List results = xpath.selectNodes( doc );

            Iterator resultIter = results.iterator();
           
            System.out.println("Document :: " + args[0] );
            System.out.println("   XPath :: " + args[1] );
View Full Code Here

    {

        XPath xpath = new Dom4jXPath( "/foo/bar/baz" );
        SAXReader reader = new SAXReader();
        Document doc = reader.read( BASIC_XML );
        List results = xpath.selectNodes( doc );
        assertEquals( 3, results.size() );
        Iterator iter = results.iterator();
        assertEquals( "baz",
                      ((Element)iter.next()).getName() );
        assertEquals( "baz",
View Full Code Here

        Attribute attribute = new DefaultAttribute("pre:foo", "bar", ns2);
        element.add(attribute);
        Document doc = new DefaultDocument(element);
       
        XPath xpath = new Dom4jXPath( "//namespace::node()" );
        List results = xpath.selectNodes( doc );
        assertEquals( 3, results.size() );

    }
   
    public void testJaxen16() throws JaxenException, DocumentException
View Full Code Here

        String document = "<a xmlns:b=\"...\"/>";
        SAXReader reader = new SAXReader();
        Document doc = reader.read( new StringReader(document) );
       
        XPath xpath = new Dom4jXPath( "/a/b" );
        List results = xpath.selectNodes( doc );
        assertEquals( 0, results.size() );

    }
   
    public void testNamespaceNodesAreInherited() throws JaxenException
View Full Code Here

            root.add(element);
            Document doc = new DefaultDocument(root);
           
            XPath xpath = new Dom4jXPath( "/*/*/namespace::node()" );

            List results = xpath.selectNodes( doc );

            assertEquals( 4,
                          results.size() );
    }
   
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.