From: Jeremias M. <dev...@gr...> - 2004-07-19 19:10:36
|
Hello Daniel On 19.07.2004 20:05:42 Daniel Greene wrote: > I'm trying to use Barcode with FOP. Sounds simple enough, as the example xsl seems to work. > However, I cannot substiture variable values in for the barcode message: > > <xsl:variable name="testit" select="FIELD_FROM_XML" /> > > <barcode:barcode xmlns:barcode="http://www.krysalis.org/barcode/ns" msg="$testit" > > ..... > </barcode> > > what I get is a barcode with literally "$testit" as the text. Yes, because you forgot the enclosing curly braces: msg="{$testit}" (See http://www.w3.org/TR/xslt#attribute-value-templates) An alternative is to do this: <barcode:barcode xmlns:barcode="http://www.krysalis.org/barcode/ns"> <xsl:attribute name="msg"> <xsl:value-of select="$testit"/> </xsl:attribute> > I tried the other way of generating them shown in the example section, with the > > <xsl:variable name="block"> > <barcode> > <ean-13/> > </barcode> > </xsl:variable> > > and later with > <xsl:copy-of select="barcode:generate($block,'test')" /> > > > I get a 'Function not supported' error.... Here, you probably forgot to declare the barcode: namespace prefix. Check the instructions here: http://barcode4j.krysalis.org/xalan-ext.html#Using+the+barcode+extension+for+Apache+Xalan I hope this helps. Jeremias Maerki |