You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by xavier gibouin <xa...@axonie.com> on 2002/10/23 13:24:09 UTC
using variable
HI
I have a probleme when i use varianle :
this my xml file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<maquettes>
<maquette nom="CPAXXCAN1">
<variables>
<var nom="zplt">DOMITEL ASSURANCES</var>
<var nom="zplttel">0810 009 009</var>
...
</variables>
</maquette>
<maquette nom="CVAXXCAN1">
<variables>
<var nom="zctr">7B03680027</var>
<var nom="zplt">DOMITEL ASSURANCES</var>
...
</variables>
</maquette>
</maquettes>
and this my xsl file in which i try to call template :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd">
<xsl:import href="./CPAXXCAN1.xsl"/>
<xsl:import href="./CVAXXCAN1.xsl"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="first" page-height="29.7cm" page-width="21.0cm" margin-top="0.0cm" margin-bottom="0.0cm" margin-left="0.0cm" margin-right="0.0cm">
<fo:region-body margin-top="0.0cm" margin-bottom="0.0cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="PRINCIPAL">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-name="first" page-position="first"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-name="PRINCIPAL">
<fo:flow flow-name="xsl-region-body">
<xsl:for-each select="maquettes/maquette">
<xsl:variable name="edition" select="@nom"/>
<xsl:call-template name="[$edition]"/>
</xsl:for-each>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
and it doesn't work :
ERROR: Could not find template named: [$edition]
where I'l wrong
thanks
Xavier Gibouin
Axonie
Espace Mercoeur
8, rue Mercoeur
44000 Nantes
02.40.48.53.23
xavier.gibouin@axonie.comHi
Re: using variable
Posted by Oleg Tkachenko <ol...@multiconn.com>.
xavier gibouin wrote:
> <xsl:variable name="edition" select="@nom"/>
> <xsl:call-template name="[$edition]"/>
Why not using regular xslt templates?
<xsl:apply-template select="@nom"/>
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel