// This variable holds the id of the node we found with the "match"
// attribute of xsl:key. This is the id we store, with the value we
// get from the nodes we find here, in the index for this key.
final LocalVariableGen parentNode =
methodGen.addLocalVariable("parentNode",
Util.getJCRefType("I"),
null, null);
// Get the 'parameter' from the stack and store it in a local var.
parentNode.setStart(il.append(new ISTORE(parentNode.getIndex())));
// Save current node and current iterator on the stack
il.append(methodGen.loadCurrentNode());
il.append(methodGen.loadIterator());
// Overwrite current iterator with one that gives us only what we want
_use.translate(classGen, methodGen);
_use.startIterator(classGen, methodGen);
il.append(methodGen.storeIterator());
final BranchHandle nextNode = il.append(new GOTO(null));
final InstructionHandle loop = il.append(NOP);
// Prepare to call buildKeyIndex(String name, int node, String value);
il.append(classGen.loadTranslet());
il.append(new PUSH(cpg, _name.toString()));
parentNode.setEnd(il.append(new ILOAD(parentNode.getIndex())));
// Now get the node value and push it on the parameter stack
il.append(methodGen.loadDOM());
il.append(methodGen.loadCurrentNode());
il.append(new INVOKEINTERFACE(getNodeValue, 2));