Re: xalan and barcode extension output
Henry Zongaro <[email protected]> Mon, 4 Jan 2010 06:30:07 -0500
| Newsgroups | gmane.text.xml.xalan.java.user |
|---|---|
| Message-ID | <OFE30872B4.8E8B0F38-ON852576A1.003E24DB-852576A1.003F2EDF@ca.ibm.com> |
Hi, Alessandro. Alessandro Zummo <[email protected]> wrote on 01/02/2010 09:29:38 AM: > I'm using the barcode4j extension for xalan with > a template like this one: > > [...] > <barcode:barcode message="00000" orientation="0"> > <barcode:code128> > <barcode:height>8mm</barcode:height> > </barcode:code128> > </barcode:barcode> > > which works nicely. However, the extension generates > a complete svg document, while I'd need only an inner node. > > Is there a way to process the output of the extension? You could store the result of the extension in a variable as a result-tree fragment, and then process the fragment using the node-set extension function. That allows you to apply path expressions to the result-tree fragment. For instance, you could do something like this: <xsl:variable name="my-bar-code"> <barcode:barcode message="00000" orientation="0"> <barcode:code128> <barcode:height>8mm</barcode:height> </barcode:code128> </barcode:barcode> </xsl:variable> <xsl:copy-of xmlns:exsl="http://exslt.org/common" select="exsl:node-set($my-bar-code)/svg:svg/path/to/inner/node"/> I hope that helps. Thanks, Henry ------------------------------------------------------------------ Henry Zongaro XML Transformation & Query Development IBM Canada Lab T/L 313-6044; Phone +1 905 413-6044 mailto:[email protected]