sax xpath

SAXReader saxReader = new SAXReader();
        Document read = saxReader.read(new File("d:\\struts.xml"));
       
        List<Node> elements = read.selectNodes("//struts/include/@file");
       
        for (Node e : elements)
        {
            System.out.println(e.getText());
        }


所需JAR包:
jaxen-1.1-beta-6.jar
dom4j-1.6.1.jar

你可能感兴趣的:(xpath)