// Only update _version field if set and different from default
if ((_version != null) && (!_version.equals(XML_VERSION))) {
field = cpg.addFieldref(TRANSLET_CLASS, "_version", STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _version));
il.append(new PUTFIELD(field));
}
// Only update _method field if "method" attribute used
if (_method != null) {
field = cpg.addFieldref(TRANSLET_CLASS, "_method", STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _method));
il.append(new PUTFIELD(field));
}
// Only update if _encoding field is "encoding" attribute used
if (_encoding != null) {
field = cpg.addFieldref(TRANSLET_CLASS, "_encoding", STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _encoding));
il.append(new PUTFIELD(field));
}
// Only update if "omit-xml-declaration" used and set to 'yes'
if (_omitHeader) {
field = cpg.addFieldref(TRANSLET_CLASS, "_omitHeader", "Z");
il.append(DUP);
il.append(new PUSH(cpg, _omitHeader));
il.append(new PUTFIELD(field));
}
// Add 'standalone' decaration to output - use text as is
if (_standalone != null) {
field = cpg.addFieldref(TRANSLET_CLASS, "_standalone", STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _standalone));
il.append(new PUTFIELD(field));
}
// Set system/public doctype only if both are set
field = cpg.addFieldref(TRANSLET_CLASS,"_doctypeSystem",STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _doctypeSystem));
il.append(new PUTFIELD(field));
field = cpg.addFieldref(TRANSLET_CLASS,"_doctypePublic",STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _doctypePublic));
il.append(new PUTFIELD(field));
// Add 'medye-type' decaration to output - if used
if (_mediaType != null) {
field = cpg.addFieldref(TRANSLET_CLASS, "_mediaType", STRING_SIG);
il.append(DUP);
il.append(new PUSH(cpg, _mediaType));
il.append(new PUTFIELD(field));
}
// Compile code to set output indentation on/off
if (_indent) {
field = cpg.addFieldref(TRANSLET_CLASS, "_indent", "Z");
il.append(DUP);
il.append(new PUSH(cpg, _indent));
il.append(new PUTFIELD(field));
}
// Forward to the translet any elements that should be output as CDATA
if (_cdata != null) {
int index = cpg.addMethodref(TRANSLET_CLASS,