title: XSLT 2.0 in command line: Directory problems
body: <p>I have a XSL Stylesheet called "EAndSST2ARXML.xsl" in the XSLT/XSLT directory. I have several XML-Files to transform in the XSLT/InputFiles directory. The Output Files should be generated in the XSLT/OutputFiles directory. The Output files should have the same name as the input files, only the extension should change from .xml to .arxml. So far I achieve this with the following command in the XSL-File:</p>
  
  <pre><code>&lt;xsl:variable name="filename"&gt;&lt;xsl:value-of select="functx:substring-before-if-contains(base-uri(),'.xml')" /&gt;&lt;/xsl:variable&gt;
    &lt;xsl:result-document href="{$filename}.arxml"&gt;
  </code></pre>
  
  <p>And I run the transformation with following commandline command:</p>
  
  <pre><code>java.exe -Xms512M -Xmx512M  -jar C:\Users\bal2LR\Desktop\XSLT\Parser\saxon9he.jar   -t  -repeat:1 -o:C:\Users\bal2LR\Desktop\XSLT\OutputFiles  -s:C:\Users\bal2LR\Desktop\XSLT\InputFiles\  C:\Users\bal2LR\Desktop\XSLT\XSLT\EAndSST2ARXML.xsl
  </code></pre>
  
  <p>The transformation runs, but there are 2 issues:</p>
  
  <ol>
  <li><p>the generated files are in the XSLT\InputFiles directory instead of the XSLT\OutputFiles directory. (I guess it's because of the commands in the XSL Stylesheet)</p></li>
  <li><p>If I run the transformation a second time, also the .arxml-files are getting transformated a second time. But I want only to transform .xml files. If the output-file already exists, it should get overwritten.</p></li>
  </ol>
  
  <p>Somebody knows how to solve these issues? I thought about a batch file, with several commands, but I have no experience with it so far.</p>