Package org.pdf4j.saxon.xpath

Examples of org.pdf4j.saxon.xpath.XPathEvaluator


    public static void main (String[] args) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder db = factory.newDocumentBuilder();
        Document doc = db.newDocument();
        XPathEvaluator xpe = new XPathEvaluator();
        String exp = "ext:sortArrayToNodeList(('fred', 'jane', 'anne', 'sue'))";
        xpe.setNamespaceContext(new NamespaceContext() {
            public String getNamespaceURI(String prefix) {
                return (prefix.equals("ext") ? "java:org.orbeon.saxon.dom.DOMObjectModel" : null);
            }
            public String getPrefix(String namespaceURI) {
                return null;
            }
            public Iterator getPrefixes(String namespaceURI) {
                return null;
            }
        });
        NodeList isList = (NodeList)xpe.evaluate(exp, doc, XPathConstants.NODESET);
        System.err.println("length " + isList.getLength());
    }
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.xpath.XPathEvaluator

Copyright © 2018 www.massapicom. 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.