You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Paul Brady <pa...@macalla.com> on 2002/12/12 13:06:42 UTC

Template.execute()

Hi,
 I am attempting to execute a template from inside an extension element. I
do the following:

QName qTemplateName = new QName(strTemplateName);

ElemTemplate template =
xslprocessorcontext.getStylesheet().getStylesheetRoot().getTemplateComposed(
qTemplateName);
template.execute(xslprocessorcontext.getTransformer());

I get the following exception when template.execute() is called:
java.lang.reflect.InvocationTargetException:
java.lang.ArrayIndexOutOfBoundsException: 20 >= 1
	at java.util.Vector.elementAt(Vector.java:417)
	at
org.apache.xml.dtm.ref.DTMStringPool.indexToString(DTMStringPool.java:128)
	at
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.getStringValue(SAX2DTM.java:1252)
	at org.apache.xpath.objects.XRTreeFrag.str(XRTreeFrag.java:280)
	at org.apache.xpath.functions.FuncConcat.execute(FuncConcat.java:99)
	at
org.apache.xpath.Expression.executeCharsToContentHandler(Expression.java:301
)
	at
org.apache.xalan.templates.ElemValueOf.execute(ElemValueOf.java:319)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2243)
	at
org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:177)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2243)
	at
org.apache.xalan.transformer.TransformerImpl.transformToRTF(TransformerImpl.
java:1773)
	at
org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:327)
	at
org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:282)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2243)
	at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:432)

Is there some extra setup I need to do before I call template.execute()? Am
I doing something else wrong?

Any help appreciated.
Paul.