use of org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep in project webtools.sourceediting by eclipse.
the class Normalizer method make_descendant_or_self.
private XPathExpr make_descendant_or_self() {
Step desc_self_node = new ForwardStep(ForwardStep.DESCENDANT_OR_SELF, new AnyKindTest());
StepExpr se = new AxisStep(desc_self_node, new ArrayList());
return new XPathExpr(0, se);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep in project webtools.sourceediting by eclipse.
the class Normalizer method make_root_self_node.
private XPathExpr make_root_self_node() {
// self::node()
Step self_node = new ForwardStep(ForwardStep.SELF, new AnyKindTest());
StepExpr self_node_expr = new AxisStep(self_node, new ArrayList());
XPathExpr self_node_xpath = new XPathExpr(0, self_node_expr);
// fn:root(self::node())
Collection args = new ArrayList();
args.add(self_node_xpath);
XPathExpr xpe = make_function(new QName("fn", "root", FnFunctionLibrary.XPATH_FUNCTIONS_NS), args);
return xpe;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep in project webtools.sourceediting by eclipse.
the class DefaultEvaluator method visit.
/**
* visit axis step.
*
* @param e
* is the axis step.
* @return a result sequence
*/
public Object visit(AxisStep e) {
ResultSequence rs = (ResultSequence) e.step().accept(this);
if (e.predicate_count() == 0)
return rs;
// I take it predicates are logical ANDS...
Focus original_focus = focus();
// go through all predicates
for (Iterator i = e.iterator(); i.hasNext(); ) {
// empty results... get out of here ? XXX
if (rs.size() == 0)
break;
set_focus(new Focus(rs));
rs = do_predicate((Collection) i.next());
}
// restore focus [context switching ;D ]
set_focus(original_focus);
return rs;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.AxisStep in project webtools.sourceediting by eclipse.
the class Normalizer method visit.
/**
* @param e
* is the axis step.
* @return e
*/
public Object visit(AxisStep e) {
Step s = (Step) e.step().accept(this);
e.set_step(s);
printCollExprs(e.iterator());
return e;
}
Aggregations