// call checkQName if the name is an AVT
final int check = cpg.addMethodref(BASIS_LIBRARY_CLASS, "checkQName",
"("
+STRING_SIG
+")V");
il.append(new INVOKESTATIC(check));
// Push handler for call to endElement()
il.append(methodGen.loadHandler());
// load name value again
nameValue.setEnd(il.append(new ALOAD(nameValue.getIndex())));
if (_namespace != null) {
_namespace.translate(classGen, methodGen);
}
else {
// If name is an AVT and namespace is not specified, need to
// look up any prefix in the stylesheet by calling
// BasisLibrary.lookupStylesheetQNameNamespace(
// name, stylesheetNode, ancestorsArray,
// prefixURIsIndexArray, prefixURIPairsArray,
// !ignoreDefaultNamespace)
String transletClassName = getXSLTC().getClassName();
il.append(DUP);
il.append(new PUSH(cpg, getNodeIDForStylesheetNSLookup()));
il.append(new GETSTATIC(cpg.addFieldref(
transletClassName,
STATIC_NS_ANCESTORS_ARRAY_FIELD,
NS_ANCESTORS_INDEX_SIG)));
il.append(new GETSTATIC(cpg.addFieldref(
transletClassName,
STATIC_PREFIX_URIS_IDX_ARRAY_FIELD,
PREFIX_URIS_IDX_SIG)));
il.append(new GETSTATIC(cpg.addFieldref(
transletClassName,
STATIC_PREFIX_URIS_ARRAY_FIELD,
PREFIX_URIS_ARRAY_SIG)));
// Default namespace is significant
il.append(ICONST_0);
il.append(
new INVOKESTATIC(
cpg.addMethodref(BASIS_LIBRARY_CLASS,
LOOKUP_STYLESHEET_QNAME_NS_REF,
LOOKUP_STYLESHEET_QNAME_NS_SIG)));
}
// Push additional arguments
il.append(methodGen.loadHandler());
il.append(methodGen.loadDOM());
il.append(methodGen.loadCurrentNode());
// Invoke BasisLibrary.startXslElemCheckQName()
il.append(new INVOKESTATIC(
cpg.addMethodref(BASIS_LIBRARY_CLASS, "startXslElement",
"(" + STRING_SIG
+ STRING_SIG
+ TRANSLET_OUTPUT_SIG
+ DOM_INTF_SIG + "I)" + STRING_SIG)));