Examples of NodeTest


Examples of org.exist.xquery.NodeTest

        final EXistTreeBuilder builder = new EXistTreeBuilder(context);
        response.outputResponseElement(builder);
        final DocumentImpl doc = builder.close();
        try {
            // we add the root *element* to the result sequence
            NodeTest kind = new TypeTest(Type.ELEMENT);
            // the elem must always be added at the front, so if there are
            // already other items, we create a new one, add the elem, then
            // add the original items after
            if(result.isEmpty()) {
                doc.selectChildren(kind, result);
View Full Code Here

Examples of org.exist.xquery.NodeTest

            LocationStep lastStep = steps.get(steps.size() - 1);
            if (firstStep != null && steps.size() == 1 && firstStep.getAxis() == Constants.SELF_AXIS) {
                final Expression outerExpr = contextInfo.getContextStep();
                if (outerExpr != null && outerExpr instanceof LocationStep) {
                    final LocationStep outerStep = (LocationStep) outerExpr;
                    final NodeTest test = outerStep.getTest();
                    if (!test.isWildcardTest() && test.getName() != null) {
                        contextQName = new QName(test.getName());
                        if (outerStep.getAxis() == Constants.ATTRIBUTE_AXIS || outerStep.getAxis() == Constants.DESCENDANT_ATTRIBUTE_AXIS)
                            {contextQName.setNameType(ElementValue.ATTRIBUTE);}
                        contextStep = firstStep;
                        axis = outerStep.getAxis();
                        optimizeSelf = true;
                    }
                }
            } else if (firstStep != null && lastStep != null) {
                final NodeTest test = lastStep.getTest();
                if (!test.isWildcardTest() && test.getName() != null) {
                    contextQName = new QName(test.getName());
                    if (lastStep.getAxis() == Constants.ATTRIBUTE_AXIS || lastStep.getAxis() == Constants.DESCENDANT_ATTRIBUTE_AXIS)
                        {contextQName.setNameType(ElementValue.ATTRIBUTE);}
                    contextStep = lastStep;
                    axis = firstStep.getAxis();
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.NodeTest

        // It must be the remaining kind of filter expression ...
        return parseFilterExpr(tokens);
    }

    protected AxisStep parseAxisStep( TokenStream tokens ) {
        NodeTest nodeTest = null;
        if (tokens.canConsume('@')) {
            // Abbreviated forward step with an attribute...
            nodeTest = new AttributeNameTest(parseNameTest(tokens));
        } else if (tokens.matches('*')) {
            // Abbreviated forward step with an wildcard element ...
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.NodeTest

        List<StepExpression> path = new ArrayList<StepExpression>();
        String tableName = null;
        for (StepExpression step : steps) {
            if (step instanceof AxisStep) {
                AxisStep axis = (AxisStep)step;
                NodeTest nodeTest = axis.getNodeTest();
                if (nodeTest instanceof NameTest) {
                    if (appliesToPathConstraint(axis.getPredicates())) {
                        // Everything in this axis/step applies to the path, so add it and we'll translate it below ...
                        path.add(step);
                    } else {
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.NodeTest

                    builder = new DualPathLikeBuilder(builder.clone(), builder.append("/%"));
                }
            } else if (step instanceof AxisStep) {
                ++depth;
                AxisStep axis = (AxisStep)step;
                NodeTest nodeTest = axis.getNodeTest();
                assert !(nodeTest instanceof ElementTest);
                if (nodeTest instanceof NameTest) {
                    NameTest nameTest = (NameTest)nodeTest;
                    builder.append('/');
                    if (nameTest.getPrefixTest() != null) {
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.NodeTest

        // It must be the remaining kind of filter expression ...
        return parseFilterExpr(tokens);
    }

    protected AxisStep parseAxisStep( TokenStream tokens ) {
        NodeTest nodeTest = null;
        if (tokens.canConsume('@')) {
            // Abbreviated forward step with an attribute...
            nodeTest = new AttributeNameTest(parseNameTest(tokens));
        } else if (tokens.matches('*')) {
            // Abbreviated forward step with an wildcard element ...
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.NodeTest

        List<StepExpression> path = new ArrayList<StepExpression>();
        String tableName = null;
        for (StepExpression step : steps) {
            if (step instanceof AxisStep) {
                AxisStep axis = (AxisStep)step;
                NodeTest nodeTest = axis.getNodeTest();
                if (nodeTest instanceof NameTest) {
                    if (appliesToPathConstraint(axis.getPredicates())) {
                        // Everything in this axis/step applies to the path, so add it and we'll translate it below ...
                        path.add(step);
                    } else {
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.NodeTest

                left = right;
                right = temp;
                operator = operator.reverse();
            }
            if (left instanceof NodeTest) {
                NodeTest nodeTest = (NodeTest)left;
                String propertyName = null;
                if (nodeTest instanceof AttributeNameTest) {
                    AttributeNameTest attribute = (AttributeNameTest)left;
                    propertyName = nameFrom(attribute.getNameTest());
                } else if (nodeTest instanceof NameTest) {
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.NodeTest

                    }
                }
            } else if (step instanceof AxisStep) {
                ++depth;
                AxisStep axis = (AxisStep)step;
                NodeTest nodeTest = axis.getNodeTest();
                assert !(nodeTest instanceof ElementTest);
                if (nodeTest instanceof NameTest) {
                    NameTest nameTest = (NameTest)nodeTest;
                    builder.append('/');
                    boolean addSns = true;
View Full Code Here

Examples of org.pdf4j.saxon.pattern.NodeTest

            while (!at.isBuiltInType()) {
                at = (AtomicType)at.getBaseType();
            }
            return SaxonXQDataFactory.mapSaxonTypeToXQJ(at.getFingerprint());
        } else if (itemType instanceof NodeTest) {
            NodeTest it = (NodeTest)itemType;
            if (it instanceof DocumentNodeTest) {
                it = ((DocumentNodeTest)it).getElementTest();
            }
            if ((it.getNodeKindMask() &
                    (1<<Type.DOCUMENT | 1<<Type.TEXT | 1<<Type.COMMENT | 1<<Type.PROCESSING_INSTRUCTION | 1<<Type.NAMESPACE)) != 0) {
                throw new XQException("Wrong node kind for getBaseType()");
            }
            SchemaType contentType = it.getContentType();
            if (contentType.isAtomicType()) {
                AtomicType at = (AtomicType)contentType;
                while (!at.isBuiltInType()) {
                    at = (AtomicType)at.getBaseType();
                }
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.