Page 1 of 1

barcode 39 with xsl fop, parametrization

Posted: Mon Jul 21, 2008 6:35 pm
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.

Re: barcode 39 with xsl fop, parametrization

Posted: Wed Jul 23, 2008 10:51 am
by Dan
Try using <xsl:value-of select="$hBarcode"/> instead of {$hBarcode}.