Search in sources :

Example 1 with ForwardAxis

use of org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis in project webtools.sourceediting by eclipse.

the class DefaultEvaluator method visit.

/**
 * visit a forward step expression
 *
 * @param e
 *            is the forward step.
 * @return a new function
 */
public Object visit(ForwardStep e) {
    // get context node
    AnyType ci = focus().context_item();
    if (ci == null)
        report_error(DynamicError.contextUndefined());
    if (!(ci instanceof NodeType))
        report_error(TypeError.ci_not_node(ci.string_type()));
    NodeType cn = (NodeType) ci;
    // get the nodes on the axis
    ForwardAxis axis = e.iterator();
    ResultBuffer rb = new ResultBuffer();
    axis.iterate(cn, rb, _dc.getLimitNode());
    // get all nodes in the axis, and principal node
    Pair arg = new Pair(axis.principal_node_kind().string_type(), rb.getSequence());
    // do the name test
    _param = arg;
    ResultSequence rs = (ResultSequence) e.node_test().accept(this);
    return rs;
}
Also used : ResultBuffer(org.eclipse.wst.xml.xpath2.api.ResultBuffer) ResultSequence(org.eclipse.wst.xml.xpath2.api.ResultSequence) NodeType(org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType) AnyType(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType) ForwardAxis(org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis) VarExprPair(org.eclipse.wst.xml.xpath2.processor.internal.ast.VarExprPair)

Aggregations

ResultBuffer (org.eclipse.wst.xml.xpath2.api.ResultBuffer)1 ResultSequence (org.eclipse.wst.xml.xpath2.api.ResultSequence)1 ForwardAxis (org.eclipse.wst.xml.xpath2.processor.internal.ForwardAxis)1 VarExprPair (org.eclipse.wst.xml.xpath2.processor.internal.ast.VarExprPair)1 AnyType (org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType)1 NodeType (org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType)1