[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

calling template with name passed in a variable

Subject: calling template with name passed in a variable
From: Piotr Dobrogost <pd@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Dec 2009 01:07:07 +0100
 calling template with name passed in a variable
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[@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 {@type}


Regards Piotr Dobrogost

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.