I would like to call a template based on an inbound parameter to an xsl stylesheet.
Using the parameter in the name attribute fails because $ is illegal in the context. Does this mean I have to use a xsl:choose to accomplish this?
I would like to call a template based on an inbound parameter to an xsl stylesheet.
Using the parameter in the name attribute fails because $ is illegal in the context. Does this mean I have to use a xsl:choose to accomplish this?
If you want to call templates selected dynamically then you can usually do it using xsl:apply-templates rather than xsl:call-template. One very general way of doing this is to change each
to
and then change your invalid
to a legitimate
And pass the context item as a parameter if necessary.
However, if we knew more about the problem you are trying to solve, we might be able to suggest a better way of solving it.
Unless you use an XSLT processor like the commercial version of Saxon 9 where you have an extension instruction like http://www.saxonica.com/documentation/extensions/instructions/call-template.xml you will need to use xsl:choose.