Where %1 is the name of the xml-source and %2 the name of the xslt file. Both without extension. The outputfile %2.txt is just a log file. I generate multiple html-files from one xml-file using xsl:document. If you don't use that you just redirect output to <filename>.html. Which gives you the html-file you want. If you want it to have the same name as the xml-source it is in this example:
I translate my XML-Doc with:
java com.icl.saxon.StyleSheet -a -o java.html java.xml
Is there a way to get in XSL then output document name?
In this case "java.html"?
Thanks
Though I'm not sure what you mean I'll give it a try. One of the batch-files I use to generate html from xml with xsl has this line:
java -cp "D:\Mijn documenten\XML\saxon6_5_1\saxon.jar" com.icl.saxon.StyleSheet %1.xml %2.xsl > %2.txt
Where %1 is the name of the xml-source and %2 the name of the xslt file. Both without extension. The outputfile %2.txt is just a log file. I generate multiple html-files from one xml-file using xsl:document. If you don't use that you just redirect output to <filename>.html. Which gives you the html-file you want. If you want it to have the same name as the xml-source it is in this example:
java -cp "D:\Mijn documenten\XML\saxon6_5_1\saxon.jar" com.icl.saxon.StyleSheet %1.xml %2.xsl > %1.html
wkg frans rops
I mean something like:
<xsl:message>
MSG: <xsl:value-of select="output:name()"/> is prozessing...
</xsl:message>
output:
MSG: java.html is prozessing...
Claudio
Just pass the output document name in as a parameter to the stylesheet:
java com.icl.saxon.StyleSheet -o java.html a.xml a.xsl output=java.html
<xsl:param name="output"/>
<xsl:message>Output file is <xsl:value-of select="$output"/></xsl:message>
To avoid typing the output filename twice, you can wrap this command in a shell script.
Mike Kay
I was trying to avoi this.. :-) but thanks a lot.
Claudio