Package xbird.util.xml

Examples of xbird.util.xml.NamespaceBinder


    }

    private static void generate() throws Exception {
        final Document catalog = XQTSTestBase.catalogPool.borrowObject();
        final XPath xpath = XPathFactory.newInstance().newXPath();
        NamespaceBinder resolver = new NamespaceBinder();
        resolver.declarePrefix(XQTSTestBase.CATALONG_URI_PREFIX, XQTSTestBase.CATALONG_URI);
        xpath.setNamespaceContext(resolver);
        int tcCount = 0, tcGenCount = 0;
        File testDestDir = new File(TEST_RESOURCE_DIR);
        assert (testDestDir.exists()) : testDestDir.getAbsolutePath();
        File destFile = new File(testDestDir, "TestCase.list");
View Full Code Here


    }

    protected static int countTests(String testPath, Document catalog)
            throws XPathExpressionException {
        final XPath xpath = XPathFactory.newInstance().newXPath();
        NamespaceBinder resolver = new NamespaceBinder();
        resolver.declarePrefix(XQTSTestBase.CATALONG_URI_PREFIX, XQTSTestBase.CATALONG_URI);
        xpath.setNamespaceContext(resolver);
        final String count = "count(" + testPath + ")";
        XPathExpression expr = xpath.compile(count);
        final Double d = (Double) expr.evaluate(catalog, XPathConstants.NUMBER);
        return d.intValue();
View Full Code Here

        return true;
    }

    private static NamespaceContext toNamespaceContexts(final String nsmap) {
        final NamespaceBinder namespaces = new NamespaceBinder();
        if(nsmap != null) {
            final String[] entries = nsmap.split(",");
            for(String entry : entries) {
                String[] items = entry.split("=");
                if(items.length != 2) {
                    throw new IllegalArgumentException("Illegal nsmap description: " + nsmap);
                }
                namespaces.declarePrefix(items[0], items[1]);
            }
        }
        return namespaces;
    }
View Full Code Here

        assert (created) : "File creation failed: " + testCaseList.getAbsolutePath();
    }

    private static void generate() throws Exception {
        final XPath xpath = XPathFactory.newInstance().newXPath();
        NamespaceBinder resolver = new NamespaceBinder();
        resolver.declarePrefix(XQTSTestBase.CATALONG_URI_PREFIX, XQTSTestBase.CATALONG_URI);
        xpath.setNamespaceContext(resolver);
        int tcCount = 0, tcGenCount = 0;
        File testDestDir = new File(TEST_RESOURCE_DIR);
        assert (testDestDir.exists()) : testDestDir.getAbsolutePath();
        File destFile = new File(testDestDir, "TestCase.list");
View Full Code Here

        pw.write(line);
    }

    protected static int countTests(String testPath) throws XPathExpressionException {
        final XPath xpath = XPathFactory.newInstance().newXPath();
        NamespaceBinder resolver = new NamespaceBinder();
        resolver.declarePrefix(XQTSTestBase.CATALONG_URI_PREFIX, XQTSTestBase.CATALONG_URI);
        xpath.setNamespaceContext(resolver);
        final String count = "count(" + testPath + ")";
        XPathExpression expr = xpath.compile(count);
        final Double d = (Double) expr.evaluate(XQTSTestBase.catalog, XPathConstants.NUMBER);
        return d.intValue();
View Full Code Here

            xqdoc.setDocumentUri(unescaped);
            _sharedCache.put(docurl, xqdoc);
        }
        // import namespace decl
        Map<String, String> nsmap = xqdoc.documentTable().getDeclaredNamespaces();
        NamespaceBinder nsResolver = dynEnv.getStaticContext().getStaticalyKnownNamespaces();
        nsResolver.declarePrefixs(nsmap);
        return xqdoc;
    }
View Full Code Here

TOP

Related Classes of xbird.util.xml.NamespaceBinder

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.