Menu

find out the output document name

Help
2002-02-12
2012-10-08
  • Claudio Thomas

    Claudio Thomas - 2002-02-12

    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

     
    • Anonymous

      Anonymous - 2002-02-12

      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

       
    • Claudio Thomas

      Claudio Thomas - 2002-02-15

      I mean something like:
      <xsl:message>
        MSG: <xsl:value-of select="output:name()"/> is prozessing...
      </xsl:message>

      output:
      MSG: java.html is prozessing...

      Claudio

       
    • Michael Kay

      Michael Kay - 2002-02-17

      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

       
    • Claudio Thomas

      Claudio Thomas - 2002-02-19

      I was trying to avoi this.. :-) but thanks a lot.

      Claudio