if (context==null) {
return "";
}
NamePool pool = context.getNamePool();
try {
InstructionInfo info = inst.getInstructionInfo();
int construct = info.getConstructType();
if (construct < 1024 &&
construct != StandardNames.XSL_FUNCTION &&
construct != StandardNames.XSL_TEMPLATE) {
// it's a standard name
if (context.getController().getExecutable().getHostLanguage() == Configuration.XSLT) {
return StandardNames.getDisplayName(construct);
} else {
String s = StandardNames.getDisplayName(construct);
int colon = s.indexOf(':');
if (colon > 0) {
String local = s.substring(colon+1);
if (local.equals("document")) {
return "document node constructor";
} else if (local.equals("text") || s.equals("value-of")) {
return "text node constructor";
} else if (local.equals("element")) {
return "computed element constructor";
} else if (local.equals("attribute")) {
return "computed attribute constructor";
} else if (local.equals("variable")) {
return "variable declaration";
} else if (local.equals("param")) {
return "external variable declaration";
}
}
return s;
}
}
switch (construct) {
case Location.LITERAL_RESULT_ELEMENT: {
StructuredQName qName = info.getObjectName(pool);
String name = "element constructor";
if (context != null) {
name += " <" + qName.getDisplayName() + '>';
}
return name;
}
case Location.LITERAL_RESULT_ATTRIBUTE: {
StructuredQName qName = info.getObjectName(pool);
String name = "attribute constructor";
if (context != null) {
name += ' ' + qName.getDisplayName() + "=\"{...}\"";
}
return name;
}
case StandardNames.XSL_FUNCTION: {
StructuredQName qName = info.getObjectName(pool);
String name = "function";
if (context != null) {
name += ' ' + qName.getDisplayName() + "()";
}
return name;
}
case StandardNames.XSL_TEMPLATE: {
StructuredQName qName = info.getObjectName(pool);
String name = "template";
if (context != null && qName != null) {
name += " name=\"" + qName.getDisplayName() + '\"';
}
return name;