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

Re: calling template with name passed in a variable

Subject: Re: calling template with name passed in a variable
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 18 Dec 2009 13:33:13 -0800
Re:  calling template with name passed in a variable
2009/12/17 Piotr Dobrogost <pd@xxxxxxxxxxxxxxxxxxxxxxxxxx>:
> Hi
> Can I call a template passing its name dynamically (by means of select or
> variable)?

Have a look at FXSL, but bear in mind that all the good people
(telling you may not actually need this) could be right.

Also, in XSLT 2.1 / XPath 2.1 higher-order functions become official.

Dimitre Novatchev
Truly great madness cannot be achieved without significant intelligence.
To invent, you need a good imagination and a pile of junk
Never fight an inanimate object
You've achieved success in your field when you don't know whether what
you're doing is work or play
I enjoy the massacre of ads. This sentence will slaughter ads without
a messy bloodbath.

> I'd like to do something like this
> <xsl:template name="MyTypeX">
> B (...)
> </xsl:template>
> <xsl:template name="MyTypeY">
> B (...)
> </xsl:template>
> <xsl:param name="InPlaceTypesList" as="element()*">
> B <type>MyTypeX</type>
> B <type>MyTypeY</type>
> </xsl:param>
> <xsl:template match="xsd:element[@type=$InPlaceTypesList]">
> B <xsl:call-template name="@type"/> // <-- error line
> </xsl:template>
> Error at xsl:call-template on line 135 column 38 of xsd2perl.xsl:
> B XTSE0020: Invalid QName {@type}
> Regards
> Piotr Dobrogost

Current Thread


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.
First Name
Last Name
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.