Re: FOP Extention Dynamically generate the message

"Andrew Nelson" <[email protected]> Tue, 18 Nov 2003 16:01:23 -0700
Newsgroups gmane.comp.krysalis.user
Message-ID <[email protected]>
Never mind i got it

<xsl:variable name="bcmsg" select="msg"/>
                  <fo:block>
                    <fo:instream-foreign-object>
                      <barcode:barcode xmlns:barcode="http://www.krysalis.org/barcode/ns"
                        message="{$bcmsg}">
                        <barcode:code128>
                          <barcode:height>8mm</barcode:height>
                        </barcode:code128>
                      </barcode:barcode>
                    </fo:instream-foreign-object>
                  </fo:block>


>>> [email protected] 11/18/03 03:27PM >>>
I'm trying to generate a pdf that includes a barcode.  The message for the barcode is stored in xml.  

The following works but obviously isn't very dynamic in nature

<fo:block>
    <fo:instream-foreign-object>
        <barcode:barcode xmlns:barcode="http://www.krysalis.org/barcode/ns" 
            msg="my message">
           <barcode:code128>
               <barcode:height>8mm</barcode:height>
           </barcode:code128>
        </barcode:barcode>
     </fo:instream-foreign-object>
 </fo:block>

So I looked around in the examples section of the cvs tree and I managed to come up with the following.

<xsl:variable name="barcode-cfg">
  <barcode>
    <code128/>
   </barcode>
</xsl:variable>
<fo:instream-foreign-object>
  <xsl:copy-of select="barcode:generate($barcode-cfg, 'my message')"/>
</fo:instream-foreign-object>

Again not very dynamic right now but it should be simple enough to asign a variable and then replace that variable with my message.

But this does not work.

The stack trace I get starts like this
; SystemID: file:///home/andy/dev_web/andy_stuff/cvs_stuff/dna_lab_v3/java/dnaprintoutgen/../../xml/printout.xsl; Line#: 310; Column#: 83
javax.xml.transform.TransformerException: org.apache.xml.dtm.DTMDOMException: 
        at org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:350)
        at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:257)
        at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:181)

I'm terribly sorry if this is a stupid question, I'm totally new to xml, xsl and the likes.  Any help would be greatly appreciated.

Thanks much 

Andy




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/ 
_______________________________________________
krysalis-users mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/krysalis-users



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/