Example usage for org.apache.commons.jxpath.ri.compiler Step getNodeTest

List of usage examples for org.apache.commons.jxpath.ri.compiler Step getNodeTest

Introduction

In this page you can find the example usage for org.apache.commons.jxpath.ri.compiler Step getNodeTest.

Prototype

public NodeTest getNodeTest() 

Source Link

Document

Get the step test.

Usage

From source file:org.chiba.xml.xpath.impl.JXPathReferenceFinderImpl.java

private void addStepReferences(Map references, Expression context, Step[] steps) {
    Path path;//from  ww w  . ja  v a 2s.  c om
    Step step;
    Step tmp;
    Expression[] predicates;

    for (int i = 0; steps != null && i < steps.length; i++) {
        step = steps[i];
        predicates = step.getPredicates();

        if (predicates != null && predicates.length > 0) {
            // create path without current predicates as context
            tmp = step;
            steps[i] = (Step) this.compiler.step(step.getAxis(), step.getNodeTest(), null);
            path = addSteps(context, steps, i + 1);
            steps[i] = tmp;

            // add references in step predicates
            for (int j = 0; j < predicates.length; j++) {
                addExpressionReferences(references, path, predicates[j]);
            }
        }
    }
}

From source file:org.xchain.framework.jxpath.JXPathValidator.java

static void validateStep(Step step, NamespaceContext xmlns) {
    validateNodeTest(step.getNodeTest(), xmlns);

    for (Expression predicate : step.getPredicates()) {
        validateExpression(predicate, xmlns);
    }//from   ww w. j  a  v a  2s.c  om
}