// Turn off character escaping if so is wanted.
if (!_escaping) {
il.append(methodGen.loadHandler());
il.append(new PUSH(cpg,false));
il.append(new INVOKEINTERFACE(setEscaping,2));
}
// Translate the contents. If the value is a string, use the
// translet.characters(String, TranslatOutputHandler) method.
// Otherwise, the value is a node, and the
// dom.characters(int node, TransletOutputHandler) method can dispatch
// the string value of the node to the output handler more efficiently.
if (_isString) {
final int characters = cpg.addMethodref(TRANSLET_CLASS,
CHARACTERSW,
CHARACTERSW_SIG);
il.append(classGen.loadTranslet());
_select.translate(classGen, methodGen);
il.append(methodGen.loadHandler());
il.append(new INVOKEVIRTUAL(characters));
} else {
final int characters = cpg.addInterfaceMethodref(DOM_INTF,
CHARACTERS,
CHARACTERS_SIG);
il.append(methodGen.loadDOM());
_select.translate(classGen, methodGen);
il.append(methodGen.loadHandler());
il.append(new INVOKEINTERFACE(characters, 3));
}
// Restore character escaping setting to whatever it was.
if (!_escaping) {
il.append(methodGen.loadHandler());
il.append(SWAP);
il.append(new INVOKEINTERFACE(setEscaping,2));
il.append(POP);
}
}