Package javax.xml.xpath

Examples of javax.xml.xpath.XPath.evaluate()


                return context.getVariable(variableName.getLocalPart());
            }
        });

    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        return xpathEvaluator.evaluate(this.expression, builder.newDocument(), XPathConstants.BOOLEAN);
    }

    public String toString() {
        return this.expression;
    }
View Full Code Here


            }
           
            Document document = getDocument(s);
               
            XPath xpath = XPathFactory.newInstance().newXPath();
            Node node = (Node) xpath.evaluate("/html/body", document, XPathConstants.NODE);

            String text = node.getTextContent();
           
            while (text.length() > 1 && (text.startsWith("\r") || text.startsWith("\n")))
                text = text.substring(1);
View Full Code Here

        resolver.declarePrefix(CATALONG_URI_PREFIX, CATALONG_URI);
        xpath.setNamespaceContext(resolver);

        final Document catalog = catalogPool.borrowObject();
        try {
            NodeList rs = (NodeList) xpath.evaluate(testPath, catalog, XPathConstants.NODESET);
            final int rslen = rs.getLength();
            for(int i = 0; i < rslen; i++) {
                if(doPrint) {
                    println("\n------------------------------------------------");
                }
View Full Code Here

                }
                final StaticContext statEnv = new StaticContext();
                statEnv.setConstructionModeStrip(true);

                Node testCase = rs.item(i);
                final String testName = xpath.evaluate("./@name", testCase);
                final String testFilePath = xpath.evaluate("./@FilePath", testCase);
                final String queryFileName = xpath.evaluate("./*[local-name()='query']/@name", testCase);
                File queryFile = new File(xqtsQueryPath, testFilePath + queryFileName + ".xq");
                final URI baseUri = new File(xqtsQueryPath, testFilePath).toURI();

View Full Code Here

                final StaticContext statEnv = new StaticContext();
                statEnv.setConstructionModeStrip(true);

                Node testCase = rs.item(i);
                final String testName = xpath.evaluate("./@name", testCase);
                final String testFilePath = xpath.evaluate("./@FilePath", testCase);
                final String queryFileName = xpath.evaluate("./*[local-name()='query']/@name", testCase);
                File queryFile = new File(xqtsQueryPath, testFilePath + queryFileName + ".xq");
                final URI baseUri = new File(xqtsQueryPath, testFilePath).toURI();

                XQueryModule xqmod = new XQueryModule();
View Full Code Here

                statEnv.setConstructionModeStrip(true);

                Node testCase = rs.item(i);
                final String testName = xpath.evaluate("./@name", testCase);
                final String testFilePath = xpath.evaluate("./@FilePath", testCase);
                final String queryFileName = xpath.evaluate("./*[local-name()='query']/@name", testCase);
                File queryFile = new File(xqtsQueryPath, testFilePath + queryFileName + ".xq");
                final URI baseUri = new File(xqtsQueryPath, testFilePath).toURI();

                XQueryModule xqmod = new XQueryModule();

View Full Code Here

                final URI baseUri = new File(xqtsQueryPath, testFilePath).toURI();

                XQueryModule xqmod = new XQueryModule();

                {// ((//*:test-group)//*:test-case)/*:module
                    NodeList moduleNodes = (NodeList) xpath.evaluate("./*[local-name()='module']", testCase, XPathConstants.NODESET);
                    final int modcount = moduleNodes.getLength();
                    if(modcount > 0) {
                        ModuleManager moduleManager = statEnv.getModuleManager();
                        SimpleModuleResolver modResolver = new SimpleModuleResolver();
                        moduleManager.setModuleResolver(modResolver);
View Full Code Here

                        SimpleModuleResolver modResolver = new SimpleModuleResolver();
                        moduleManager.setModuleResolver(modResolver);
                        for(int j = 0; j < modcount; j++) {
                            Node moduleNode = moduleNodes.item(j);
                            String moduleId = moduleNode.getTextContent();
                            String moduleFileStr = xpath.evaluate("/*[local-name()='test-suite']/*[local-name()='sources']/*[local-name()='module']/@FileName[../@ID='"
                                    + moduleId + "']", catalog);
                            File moduleFile = new File(xqtsDir, moduleFileStr + ".xq");
                            String physical = moduleFile.toURI().toString();
                            String logical = xpath.evaluate("./@namespace", moduleNode);
                            modResolver.addMappingRule(logical, physical);
View Full Code Here

                            String moduleId = moduleNode.getTextContent();
                            String moduleFileStr = xpath.evaluate("/*[local-name()='test-suite']/*[local-name()='sources']/*[local-name()='module']/@FileName[../@ID='"
                                    + moduleId + "']", catalog);
                            File moduleFile = new File(xqtsDir, moduleFileStr + ".xq");
                            String physical = moduleFile.toURI().toString();
                            String logical = xpath.evaluate("./@namespace", moduleNode);
                            modResolver.addMappingRule(logical, physical);
                        }
                    }
                }
                {// ((//*:test-group)//*:test-case)/*:input-file
 
View Full Code Here

                            modResolver.addMappingRule(logical, physical);
                        }
                    }
                }
                {// ((//*:test-group)//*:test-case)/*:input-file
                    NodeList vars1 = (NodeList) xpath.evaluate("./*[local-name()='input-file']/@variable", testCase, XPathConstants.NODESET);
                    loadVariables(vars1, testCase, xqmod, statEnv, xpath, catalog, false);
                }
                { // ((//*:test-group)//*:test-case)/*:input-URI
                    NodeList vars2 = (NodeList) xpath.evaluate("./*[local-name()='input-URI']/@variable", testCase, XPathConstants.NODESET);
                    loadVariables(vars2, testCase, xqmod, statEnv, xpath, catalog, true);
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.