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

Re: using xsl:call-template dynamicly

Subject: Re: using xsl:call-template dynamicly
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 21 Apr 2010 13:41:32 +0200
Re:  using xsl:call-template dynamicly
Red Light wrote:
Hi ,

i'm using apache fop , and i want in my xsl to dynamicly call a template

for example i got a main xsl file==> main.xsl (which i mport a xsl file ==> subreport1.xsl)

in this subreport1.xsl file i got a template that i declare like that :

 <xsl:template  match="projectDetailSection">
 <xsl:template>

and in my main template (main.xsl)

i call the template with:

<xsl:call-template name="projectDetailSection" />

that's the normal case it's working.

Is that working? I don't think it can work if you have match="projectDetailSection" on your xsl:template, you would need name="projectDetailSection"

> Now how could i call a templace dynamicly like:


i define the variable:

<xsl:variable name="var1" saxon:assignable="yes">projectDetailSection </xsl:variable>

Why is there white space after "projectDetailSection"?


and then i call the tempalte dynamicly:

<xsl:call-template
 name="{$var1}" saxon:allow-avt="yes" ></xsl:call-template>


my actual code doens't work even if i use saxon ....

Which version of Saxon is that? http://www.saxonica.com/documentation/extensions/attributes.html does not list any such attribute. It seems with Saxon 9.2 you would need to use
<saxon:call-template name="{$var1}">
if I understand http://www.saxonica.com/documentation/xsl-elements/call-template.html correctly.


--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.