[xsl] Using XSL for creating DOS batch files

Subject: [xsl] Using XSL for creating DOS batch files
From: <michella@xxxxxxx>
Date: Mon, 11 Oct 2004 16:38:15 +0200
Hi all,

The following code sample creates a procXml.bat files containing
multiple commands to be executed sequentially.

[...]
<xsl:output name="bat" method="text" version="1.0" encoding="ascii"
indent="no"/>
[...]
<xsl:template match="/">
	<xsl:result-document href="procXml.bat" format="bat">
 		<xsl:for-each-group
select="/Classes/Class/SADefinition[contains(@SAObjName,'app_')]"
group-by="@SAObjName">
			<xsl:sort select="@SAObjName"/>
			<xsl:if
test="not(@SAObjName=/following-sibling::*[position()=1]/@SAObjName)">

				<xsl:value-of select="concat('fop -fo
',@SAObjName,'.fo -pdf ',@SAObjName,'.pdf&#xD;&#xA;')"/>

			</xsl:if>
		</xsl:for-each-group>
	</xsl:result-document>
</xsl:template>

And here is the output (procXml.bat):

fop -fo app_AdmSpm.fo -pdf app_AdmSpm.pdf
fop -fo app_AQis.fo -pdf app_AQis.pdf
fop -fo app_AusbildungVorOrt.fo -pdf app_AusbildungVorOrt.pdf
fop -fo app_Bestad.fo -pdf app_Bestad.pdf
fop -fo app_Bipa.fo -pdf app_Bipa.pdf
fop -fo app_Bmz.fo -pdf app_Bmz.pdf
fop -fo app_Elz.fo -pdf app_Elz.pdf
fop -fo app_Elze_Bz.fo -pdf app_Elze_Bz.pdf
...


When I launch it in the command prompt, it will only run the first line,
but not the others, then comes back to the prompt.

For info : I tried to replace '&#xD;&#xA' by '&#10;&#13', which won't
result to significant changes... furthermore, I changed the encode
option into UTF-8 and US-ASCII. Nothing changed!

Any help would be greatful ;-)

Lawrence Michel

Current Thread