barcode 39 with xsl fop, parametrization

Here should go questions about transforming XML with XSLT and FOP.
folal
Posts: 1
Joined: Mon Jul 21, 2008 6:24 pm

barcode 39 with xsl fop, parametrization

Post by folal »

I have to parametrize dinamically the barcode39 height, bat this code doesn't work:

<xsl:variable name="hBarcode" select="//report/parametri/parametro[@nomeParametro='heightBarcode']"/>

<xsl:variable name="barcode-cfg">
<barcode>
<code39>
<module-height>{$hBarcode}mm</module-height>
</code39>
</barcode>
</xsl:variable>
<fo:block>
<fo:instream-foreign-object>
<xsl:variable name="bc" select="barcode:generate($barcode-cfg, barCode)"/>
<svg:svg xmlns:svg="http://www.w3.org/2000/svg">
<xsl:attribute name="width"><xsl:value-of select="$bc/svg:svg/@width"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$bc/svg:svg/@height"/></xsl:attribute>
<svg:rect x="0mm" y="0mm" fill="white">
<xsl:attribute name="width"><xsl:value-of select="$bc/svg:svg/@width"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$bc/svg:svg/@height"/></xsl:attribute>
</svg:rect>
<xsl:copy-of select="$bc"/>
</svg:svg>
</fo:instream-foreign-object>
</fo:block>

The problm is {$hBarcode} but I don't know I can write that.
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: barcode 39 with xsl fop, parametrization

Post by Dan »

Try using <xsl:value-of select="$hBarcode"/> instead of {$hBarcode}.
Post Reply