use of org.sirix.axis.ForAxis in project sirix by sirixdb.
the class PipelineBuilder method addForExpression.
/**
* Adds a for expression to the pipeline. In case the for expression has more then one for
* condition, the for expression is converted to a nested for expression with only one for
* condition each, see the following example: for $a in /a, $b in /b, $c in /c return /d is
* converted to for $a in /a return for $b in /b return for $c in /c return /d
*
* @param mForConditionNum Number of all for conditions of the expression
*/
public void addForExpression(final int mForConditionNum) {
assert getPipeStack().size() >= (mForConditionNum + 1);
Axis forAxis = (getPipeStack().pop().getExpr());
int num = mForConditionNum;
while (num-- > 0) {
forAxis = new ForAxis(getPipeStack().pop().getExpr(), forAxis);
}
if (getPipeStack().empty() || getExpression().getSize() != 0) {
addExpressionSingle();
}
getExpression().add(forAxis);
}
Aggregations