| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.expr.flwor; |
| 9 |
|
| 10 |
import net.sf.saxon.expr.XPathContext; |
| 11 |
import net.sf.saxon.om.Sequence; |
| 12 |
import net.sf.saxon.trans.XPathException; |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
public class LetClausePush extends TuplePush { |
| 18 |
|
| 19 |
TuplePush destination; |
| 20 |
LetClause letClause; |
| 21 |
|
| 22 |
public LetClausePush(TuplePush destination, LetClause letClause) { |
| 23 |
this.destination = destination; |
| 24 |
this.letClause = letClause; |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
@Override |
| 31 |
public void processTuple(XPathContext context) throws XPathException { |
| 32 |
Sequence<?> val = letClause.getEvaluator().evaluate(letClause.getSequence(), context); |
| 33 |
context.setLocalVariable(letClause.getRangeVariable().getLocalSlotNumber(), val); |
| 34 |
destination.processTuple(context); |
| 35 |
} |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
@Override |
| 41 |
public void close() throws XPathException { |
| 42 |
destination.close(); |
| 43 |
} |
| 44 |
} |
| 45 |
|