Examples of XOMXPath


Examples of org.jaxen.xom.XOMXPath

        super( name );
    }

    public void testConstruction() throws JaxenException
    {
        new XOMXPath( "/foo/bar/baz" );
    }
View Full Code Here

Examples of org.jaxen.xom.XOMXPath

        new XOMXPath( "/foo/bar/baz" );
    }

    public void testSelection() throws ParsingException, IOException, JaxenException
    {
        XPath xpath = new XOMXPath( "/foo/bar/baz" );

        Builder builder = new Builder();

        Document doc = builder.build( BASIC_XML );

        List results = xpath.selectNodes( doc );

        assertEquals( 3,
                      results.size() );

        Iterator iter = results.iterator();
View Full Code Here

Examples of org.jaxen.xom.XOMXPath

   
    public static void main(String[] args) {
       
        try {
            Document doc = new Builder().build("http://www.ibiblio.org/xml/examples/shakespeare/much_ado.xml");
            XOMXPath xpath = new XOMXPath("PLAY/ACT/SCENE/SPEECH/SPEAKER");
           
            long start = System.currentTimeMillis();
           
            int count = 0;
            for (int i = 0; i < 1000; i++) {
                Element speaker = (Element) xpath.selectSingleNode(doc);
                count += (speaker == null ? 0 : 1);
            }
           
            long end = System.currentTimeMillis();
            System.out.println((end - start));
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.