xslt named template, call template

Call-template

1. xsl:call-template name problem
2. Should I use call or apply templates?

1.

xsl:call-template name problem

Kay Michael

When I write

>  <xsl:call-template 
name="$v1"/> 
	    <!-- this causes an error --> 

The name attribute of xsl:call-template must be a QName, not an XPath expression.

There is no mechanism in XSLT for calling a template whose name is not known and fixed at the time you write the stylesheet - other than generating a stylesheet dynamically and executing that.

2.

Should I use call or apply templates?

Phil Lanch

call-template, unlike apply-templates, doesn't change the context node. Also, a select attribute is only meaningful on apply-templates, not on call-template