Package net.sf.saxon.pattern

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


    }

    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

            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

      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

            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

    * @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

            attributes = (AttributeCollectionImpl)element.getAttributeList();
            AttributeCollection attlist = element.getAttributeList();
            index = 0;

            if (nodeTest instanceof NameTest) {
              NameTest test = (NameTest)nodeTest;
                index = attlist.getIndexByFingerprint(test.getFingerprint());

                if (index<0) {
                    next = null;
                } else {
                    next = new AttributeImpl(element, index);
View Full Code Here

    public Expression bindVariable(StructuredQName qName) throws XPathException {
        XSLVariableDeclaration xslVariableDeclaration = element.bindVariable(qName);
        if (xslVariableDeclaration == null) {
            if (NamespaceConstant.ERR.equals(qName.getNamespaceURI())) {
                AxisIterator catchers = element.iterateAxis(Axis.ANCESTOR_OR_SELF,
                        new NameTest(Type.ELEMENT, NamespaceConstant.SAXON, "catch", getNamePool()));
                StyleElement catcher = (StyleElement)catchers.next();
                if (catcher != null) {
                    for (int i=0; i<errorVariables.length; i++) {
                        if (errorVariables[i].getLocalName().equals(qName.getLocalName())) {
                            IntegratedFunctionLibrary lib = getConfiguration().getVendorFunctionLibrary();
View Full Code Here

     * @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

                while (true) {
                    NodeInfo att1 = (NodeInfo)a1.next();
                    if (att1 == null) break;

                    AxisIterator a2iter = n2.iterateAxis(Axis.ATTRIBUTE,
                                            new NameTest(Type.ATTRIBUTE, att1.getFingerprint(), pool));
                    NodeInfo att2 = (NodeInfo)a2iter.next();

                    if (att2==null) {
                        explain(config, "one element has an attribute " +
                                config.getNamePool().getClarkName(att1.getFingerprint()) +
View Full Code Here

TOP

Related Classes of net.sf.saxon.pattern.NameTest

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.