Re: Attribute msg instead of mesage in <barcode:barcode...>-Tag ?

Jeremias Maerki <[email protected]> Sun, 23 May 2004 22:26:50 +0200
Newsgroups gmane.comp.krysalis.user
Message-ID <[email protected]>
Hi Dirk

On 23.05.2004 22:13:46 Dirk V. Schesmer wrote:
> Hi there,
> I am in the process to get krysalis-barcode-1.0beta up and running. It 
> works if I enter the barcode attribute "msg" instead of  "message" as 
> shown in the example.

I know. I've made a mistake there. In the next release both "msg" and
"message" will work. I hope I can do that soon.

> The last problem I (hopefully) have is more related to XSLT: In my 
> example file myCode128.xml I include a tag <AutoID> containing a unique 
> RFID hex code. I want to generate a Code128 Barcode having the value 
> "E007000011FE617A".
> 
> Unfortunately, I cannot manage it to get the <AutoID> value 
> "E007000011FE617A" contained in the XML-file to be transfered into the 
> "msg"-attribute of the <barcode> tag. I was trying to use an 
> xsl:variable, but without success. Can please someone give me a hint how 
> to achieve this ?
> 
> Thanks for help,
> Dirk V. Schesmer
> Stuttgart/Germany
> 
> myCode128.xml:
> ...
> <AutoID>E007000011FE617A</AutoID>
> ...
> 
> 
> myCode128.xsl:
> 
> <xsl:template match="AutoID">
>     <fo:block>
>         <fo:instream-foreign-object>
>             <xsl:variable name="Code128Message" select="."/>
>                 <xsl:message>Code128Message: <xsl:value-of 
> select="$Code128Message"/></xsl:message>
>             <barcode:barcode 
> xmlns:barcode="http://www.krysalis.org/barcode/ns" msg="$Code128Message">
>                 <barcode:code128>
>                     <barcode:height>12mm</barcode:height>
>                 </barcode:code128>
>             </barcode:barcode>
>         </fo:instream-foreign-object>
>     </fo:block>
> </xsl:template>

Two possibilities:
1. msg="{$Code128Message}"
2. use an xsl:attribute element:

<barcode:barcode 
    xmlns:barcode="http://www.krysalis.org/barcode/ns">
  <xsl:attribute name="msg">
    <xsl:value-of select="$Code128Message"/>
  </xsl:attribute>
    <barcode:code128>

Good luck!

Jeremias Maerki



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click