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

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

Introduction

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

Prototype

public int getAxis() 

Source Link

Document

Get the axis code.

Usage

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

private void addStepReferences(Map references, Expression context, Step[] steps) {
    Path path;/*from w ww.j  a v  a2  s .c o m*/
    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]);
            }
        }
    }
}