xsl-list
[Top] [All Lists]

[xsl] calling template with name passed in a variable

2009-12-17 19:08:05
Hi

Can I call a template passing its name dynamically (by means of select or variable)?

I'd like to do something like this

<xsl:template name="MyTypeX">
  (...)
</xsl:template>

<xsl:template name="MyTypeY">
  (...)
</xsl:template>

<xsl:param name="InPlaceTypesList" as="element()*">
  <type>MyTypeX</type>
  <type>MyTypeY</type>
</xsl:param>

<xsl:template match="xsd:element[(_at_)type=$InPlaceTypesList]">
  <xsl:call-template name="@type"/> // <-- error line
</xsl:template>

Error at xsl:call-template on line 135 column 38 of xsd2perl.xsl:
  XTSE0020: Invalid QName {(_at_)type}


Regards
Piotr Dobrogost

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--