Examples of NameTest


Examples of net.sf.saxon.pattern.NameTest

        if (!(href.equals(collectionElement.getAttributeValue(IDNC)) || (href.equals("") && isDefault))) {
            throw new XPathException("Unknown collection name " + href);
        }

        AxisIterator iter = collectionElement.iterateAxis(
                Axis.CHILD, new NameTest(Type.ELEMENT, inputDocumentNC, pool));
        List documents = new ArrayList(5);

        while (true) {
            NodeInfo m = (NodeInfo)iter.next();
            if (m==null) {
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

    }

    private NameTest elementNameTest(NamePool pool, String local) {
        int nameFP = pool.allocate("", "http://www.w3.org/2005/02/query-test-XQTSCatalog", local) & NamePool.FP_MASK;
        return new NameTest(Type.ELEMENT, nameFP, pool);
    }
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

                    new File(saxonDir + "/results" + Version.getProductVersion() + ".log")));

            MyErrorListener errorListener = new MyErrorListener(log);
            saConfig.setErrorListener(errorListener);

            NameTest testCaseNT = elementNameTest(pool, "test-case");
            NameTest inputUriNT = elementNameTest(pool, "input-URI");
            NameTest inputFileNT = elementNameTest(pool, "input-file");
            NameTest queryNT = elementNameTest(pool, "query");
            NameTest inputQueryNT = elementNameTest(pool, "input-query");
            NameTest contextItemNT = elementNameTest(pool, "contextItem");
            NameTest outputFileNT = elementNameTest(pool, "output-file");
            NameTest sourceNT = elementNameTest(pool, "source");
            NameTest schemaNT = elementNameTest(pool, "schema");
            NameTest expectedErrorNT = elementNameTest(pool, "expected-error");
            NameTest collectionNT = elementNameTest(pool, "collection");
            NameTest defaultCollectionNT = elementNameTest(pool, "defaultCollection");
            NameTest optimizationNT = elementNameTest(pool, "optimization");


            int schemaAtt = pool.allocate("", "", "schema") & NamePool.FP_MASK;
            int nameAtt = pool.allocate("", "", "name") & NamePool.FP_MASK;
            int filePathAtt = pool.allocate("", "", "FilePath") & NamePool.FP_MASK;
            int fileNameAtt = pool.allocate("", "", "FileName") & NamePool.FP_MASK;
            int idAtt = pool.allocate("", "", "ID") & NamePool.FP_MASK;
            int compareAtt = pool.allocate("", "", "compare") & NamePool.FP_MASK;
            int variableAtt = pool.allocate("", "", "variable") & NamePool.FP_MASK;
            int scenarioAtt = pool.allocate("", "", "scenario") & NamePool.FP_MASK;
            int explainAtt = pool.allocate("", "", "explain") & NamePool.FP_MASK;
            int assertAtt = pool.allocate("", "", "assert") & NamePool.FP_MASK;
            int versionAtt = pool.allocate("", "", "version") & NamePool.FP_MASK;
            int specVersionAtt = pool.allocate("", "", "spec-version") & NamePool.FP_MASK;

            /**
             * Look for an exceptions.xml document with the general format:
             *
             * <exceptions>
             *   <exception>
             *     <tests>testname1 testname2 ...</tests>
             *     <decription>text explanation</description>
             *   </exception>
             * </exceptions>
             *
             * Tests listed in this file will not be run.
             */

            DocumentInfo exceptionsDoc = saConfig.buildDocument(
                    new StreamSource(new File(saxonDir + "/exceptions.xml"))
            );

            NameTest exceptionTestsNT = new NameTest(Type.ELEMENT, pool.allocate("", "", "tests"), pool);
            AxisIterator exceptionTestCases = exceptionsDoc.iterateAxis(Axis.DESCENDANT, exceptionTestsNT);
            while (true) {
                NodeInfo testCase = (NodeInfo)exceptionTestCases.next();
                if (testCase == null) {
                    break;
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

    Writer results;
    int xlinkHref;

    private NameTest elementNameTest(NamePool pool, String local) {
        int nameFP = pool.allocate("", testNS, local) & NamePool.FP_MASK;
        return new NameTest(Type.ELEMENT, nameFP, pool);
    }
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

            parser = catalogConfig.getSourceParser();

            xlinkHref = pool.allocate("", "http://www.w3.org/1999/xlink", "href");

            int testCaseFP = pool.allocate("", "", "testcase") & NamePool.FP_MASK;
            NameTest testCaseNT = new NameTest(Type.ELEMENT, testCaseFP, pool);
            int commentFP = pool.allocate("", "", "comment") & NamePool.FP_MASK;
            NameTest commentNT = new NameTest(Type.ELEMENT, commentFP, pool);

            NameTest testSetRefNT = elementNameTest(pool, "testSetRef");
            NameTest testGroupNT = elementNameTest(pool, "testGroup");
            NameTest testSetNT = elementNameTest(pool, "testSet");
            NameTest schemaTestNT = elementNameTest(pool, "schemaTest");
            NameTest instanceTestNT = elementNameTest(pool, "instanceTest");
            NameTest schemaDocumentNT = elementNameTest(pool, "schemaDocument");
            NameTest instanceDocumentNT = elementNameTest(pool, "instanceDocument");
            NameTest expectedNT = elementNameTest(pool, "expected");
            NameTest currentNT = elementNameTest(pool, "current");

            int validityAtt = pool.allocate("", "", "validity") & NamePool.FP_MASK;
            int nameAtt = pool.allocate("", "", "name") & NamePool.FP_MASK;
            int contributorAtt = pool.allocate("", "", "contributor") & NamePool.FP_MASK;
            int setAtt = pool.allocate("", "", "set") & NamePool.FP_MASK;
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

    }

    private NameTest elementNameTest(NamePool pool, String local) {
        int nameFP = pool.allocate("", "http://www.w3.org/2005/05/xslt20-test-catalog", local) & NamePool.FP_MASK;
        return new NameTest(Type.ELEMENT, nameFP, pool);
    }
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

            factory.setErrorListener(errorListener);
            sfactory.setErrorListener(errorListener);

            String testURI = "http://www.w3.org/2005/05/xslt20-test-catalog";
            int testCaseFP = pool.allocate("", testURI, "testcase") & NamePool.FP_MASK;
            NameTest testCaseNT = new NameTest(Type.ELEMENT, testCaseFP, pool);

            NameTest nameNT = elementNameTest(pool, "name");
            NameTest inputNT = elementNameTest(pool, "input");
            NameTest outputNT = elementNameTest(pool, "output");
            NameTest stylesheetNT = elementNameTest(pool, "stylesheet");
            NameTest schemaNT = elementNameTest(pool, "schema");
            NameTest initialModeNT = elementNameTest(pool, "initial-mode");
            NameTest entryNamedTemplateNT = elementNameTest(pool, "entry-named-template");
            NameTest sourceDocumentNT = elementNameTest(pool, "source-document");
            NameTest stylesheetParametersNT = elementNameTest(pool, "stylesheet-parameters");
            NameTest paramNT = elementNameTest(pool, "param");
            NameTest resultDocumentNT = elementNameTest(pool, "result-document");
            NameTest errorNT = elementNameTest(pool, "error");
            NameTest validationNT = elementNameTest(pool, "validation");
            NameTest discretionaryItemsNT = elementNameTest(pool, "discretionary-items");
            NameTest discretionaryFeatureNT = elementNameTest(pool, "discretionary-feature");
            NameTest discretionaryChoiceNT = elementNameTest(pool, "discretionary-choice");
            NameTest initialContextNodeNT = elementNameTest(pool, "initial-context-node");
            NameTest optimizationNT = elementNameTest(pool, "optimization");


            int fileAtt = pool.allocate("", "", "file") & NamePool.FP_MASK;
            int errorIdAtt = pool.allocate("", "", "error-id") & NamePool.FP_MASK;
            int typeAtt = pool.allocate("", "", "type") & NamePool.FP_MASK;
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

      if (test == AnyNodeTest.getInstance()) { // performance hack
        test = null; // mark as AnyNodeTest
      }
      else if (test instanceof NameTest) {
        NameTest nt = (NameTest) test;
        if (nt.getPrimitiveType() == Type.ELEMENT) { // performance hack
          // mark as element name test
          NamePool pool = getNamePool();
          testLocalName = pool.getLocalName(nt.getFingerprint());
          testURI = pool.getURI(nt.getFingerprint());
        }
      }
      else if (test instanceof NodeKindTest) {
        if (test.getPrimitiveType() == Type.ELEMENT) { // performance hack
          // mark as element type test
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

            if (test == AnyNodeTest.getInstance()) { // performance hack
        test = null; // mark as AnyNodeTest
      }
      else if (test instanceof NameTest) {
        NameTest nt = (NameTest) test;
        if (nt.getPrimitiveType() == Type.ELEMENT) { // performance hack
          // mark as element name test
          NamePool pool = getNamePool();
          testLocalName = pool.getLocalName(nt.getFingerprint());
          testURI = pool.getURI(nt.getFingerprint());
        }
      }
      else if (test instanceof NodeKindTest) {
        if (test.getPrimitiveType() == Type.ELEMENT) { // performance hack
          // mark as element type test
View Full Code Here

Examples of net.sf.saxon.pattern.NameTest

    * @param fingerprint The fingerprint of the attribute name
    * @return the attribute value if it exists or null if not
    */

    public String getAttributeValue(int fingerprint) {
        NameTest test = new NameTest(Type.ATTRIBUTE, fingerprint, getNamePool());
        AxisIterator iterator = iterateAxis(Axis.ATTRIBUTE, test);
        NodeInfo attribute = (NodeInfo)iterator.next();
        if (attribute == null) {
            return null;
        } else {
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.