xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Sancho <pascal.san...@takoma.fr>
Subject Re: use xsl:call-template dynamicly!
Date Wed, 21 Apr 2010 12:10:41 GMT
Hi,

This list is for FOP usage. You should ask XSLT questions on the right
list (see [1]).
That said, you cannot use a variable for such call.
Instead, you should try a xls:choose strucure:

<xsl:choose>
  <xsl:when test="$myVar='case1'">
    <xsl:call-template name="doThis"/>
  </xsl:when>
  <!-- insert other cases here -->
</xsl:choose>

[1] http://www.mulberrytech.com/xsl/xsl-list

Pascal


Red Light a écrit :
> Hi ,
>
> 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.Now how could i  call a templace dynamicly like:
>
>
> i define the variable:
>
> <xsl:variable name="var1" saxon:assignable="yes">projectDetailSection         </xsl:variable>
>
> 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 ....
>
>
> and thanks a lot for your help
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message