[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] Generating barcode SVG-files
Subject: RE: [xsl] Generating barcode SVG-files From: cknell@xxxxxxxxxx Date: Mon, 10 Apr 2006 10:13:40 -0400 |
<xsl:result-document> is better if what you are trying to achieve is more than one output per transformation. It's better because <xsl:document> is used to create an intermediate document upon which you intend to do further processing in the same transformation. Of course, if you don't intend to output multiple documents from a single transformation, it's hard to see why you would use it at all. In any case, neither is available in XSLT 1.0. That's important because your stylesheet is declared as a 1.0 stylesheet. It's not clear what this has to do with the sample input and stylesheet you provided. If you explain your problem a little further, someone will be able to help. -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: Asbjxrn Reglund Thorsen <a.r.thorsen@xxxxxxxxxxx> Sent: Mon, 10 Apr 2006 13:31:57 +0200 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Generating barcode SVG-files I have used RenderX's 2to5 interleave barcode generator. My question is: How can I generate 222222.svg, 123456.svg and 019283.svg files (see my test-XML below) ? I probably need to make a recurcive template ? I was told that I should use xsl:document. Is xsl:result-document better in any way ? My test-XML: --------------------------------- <?xml version="1.0"?> <doc> <barcodes> <barcode value="222222" addchecksum="false"/> <barcode value="123456" addchecksum="false"/> <barcode value="019283" addchecksum="false"/> </barcodes> </doc> My test-XSL: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:import href="2of5i.xsl"/> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <fo:root font-family="Times" font-size="10pt"> <fo:layout-master-set> <fo:simple-page-master master-name="barcodes-page"> <fo:region-body margin="0.5in" border="0.25pt solid silver" padding="10pt"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="barcodes-page"> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates/> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template match="barcodes"> <xsl:for-each select="barcode"> <xsl:apply-templates select="." mode="draw"/> </xsl:for-each> </xsl:template> <!-- This template call barcode generator to create SVG representation of 2-of-5 interleave barcode --> <xsl:result-document href="mytestfile.svg"> <!-- this doesn't work but illustrates how lost I am --> <xsl:template match="barcode" mode="draw"> <fo:block> <fo:instream-foreign-object content-width="20mm" content-height="20mm"> <xsl:call-template name="barcode-2of5i"> <xsl:with-param name="value" select="@value"/> <xsl:with-param name="addchecksum" select="@addchecksum"/> </xsl:call-template> </fo:instream-foreign-object> </fo:block> </xsl:template> </xsl:result-document> </xsl:stylesheet> -- Asbjxrn Thorsen "HAKONA MATATA" ;-)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Generating barcode SVG-files, Asbjørn Reglund Thor | Thread | Re: [xsl] Generating barcode SVG-fi, Asbjørn Reglund Thor |
[xsl] Generating barcode SVG-files, Asbjørn Reglund Thor | Date | [xsl] Saxon, Carmelo Montanez |
Month |