/** * Display a representation of the stack frame on the specified output stream * @param out the output stream */ public void print(PrintStream out) { out.println(" at " + functionName.getDisplayName() + "() " + "(" + getSystemId() + "#" + getLineNumber() + ")"); } }
ContextStackFrame.FunctionCall sf = new ContextStackFrame.FunctionCall(); UserFunctionCall ufc = (UserFunctionCall)origin; sf.setSystemId(ufc.getSystemId()); sf.setLineNumber(ufc.getLineNumber()); sf.setContainer(ufc.getContainer()); sf.setFunctionName(ufc.getFunctionName()); sf.setContextItem(context.getContextItem()); next = context.getCaller(); return sf;
return new ContextStackFrame.BuiltInTemplateRule(context); } else if (origin instanceof UserFunction) { ContextStackFrame.FunctionCall sf = new ContextStackFrame.FunctionCall(); UserFunction ufc = (UserFunction) origin; sf.setLocation(ufc.getLocation()); sf.setFunctionName(ufc.getFunctionName()); sf.setContextItem(context.getContextItem()); next = getMajorCaller(context); return sf; } else if (origin instanceof UserFunctionCall) { ContextStackFrame.FunctionCall sf = new ContextStackFrame.FunctionCall(); UserFunctionCall ufc = (UserFunctionCall) origin; sf.setLocation(ufc.getLocation()); sf.setFunctionName(ufc.getFunctionName()); sf.setContextItem(context.getContextItem()); next = getMajorCaller(context); return sf;
return new ContextStackFrame.BuiltInTemplateRule(context); } else if (origin instanceof UserFunction) { ContextStackFrame.FunctionCall sf = new ContextStackFrame.FunctionCall(); UserFunction ufc = (UserFunction) origin; sf.setLocation(ufc.getLocation()); sf.setFunctionName(ufc.getFunctionName()); sf.setContextItem(context.getContextItem()); sf.setContext(context); next = getMajorCaller(context); return sf; } else if (origin instanceof UserFunctionCall) { ContextStackFrame.FunctionCall sf = new ContextStackFrame.FunctionCall(); UserFunctionCall ufc = (UserFunctionCall) origin; sf.setLocation(ufc.getLocation()); sf.setFunctionName(ufc.getFunctionName()); sf.setContextItem(context.getContextItem()); sf.setContext(context); next = getMajorCaller(context); return sf;
private static String getInstructionName(ContextStackFrame frame) { if (frame instanceof ContextStackFrame.FunctionCall) { StructuredQName name = ((ContextStackFrame.FunctionCall)frame).getFunctionName(); if (name != null) return name.getClarkName() + "()"; } else if (frame instanceof ContextStackFrame.ApplyTemplates) { String name = "xsl:apply-templates"; Item node = frame.getContextItem(); if (node instanceof NodeInfo) name += " processing " + Navigator.getPath((NodeInfo)node); return name; } else if (frame instanceof ContextStackFrame.CallTemplate) { return "xsl:call-template name=\"" + ((ContextStackFrame.CallTemplate)frame).getTemplateName().getDisplayName() + "\""; } else if (frame instanceof ContextStackFrame.VariableEvaluation) { Object container = frame.getContainer(); if (container instanceof Actor) { return getInstructionName((Actor)container); } else if (container instanceof TemplateRule) { return "xsl:template match=\"" + ((TemplateRule)container).getMatchPattern().toString() + "\""; } } return null; }
/** * Display a representation of the stack frame on the specified output stream * * @param out the output stream */ public void print(Logger out) { out.error(" at " + (functionName == null ? "(anonymous)" : functionName.getDisplayName()) + "() " + showLocation()); } }
/** * Display a representation of the stack frame on the specified output stream * * @param out the output stream */ public void print(Logger out) { out.error(" at " + (functionName == null ? "(anonymous)" : functionName.getDisplayName()) + "() " + showLocation()); }