Do you know if you can process all files in a folder including the subfolders with Saxon?

There's no option on the Saxon command line to process a directory recursively, largely because of the complexity of producing an output directory structure that mirrors the input hierarchy.

You can process a directory using the collection function. You could handle this in a front-end stylesheet that imports your current stylesheet and does something like this:

<xsl:import href="conversion-to-dtd-wip1.xsl"/>
<xsl:param name="dir" required="yes"/>
<xsl:template name="main">
  <xsl:for-each select="collection(concat($dir, '?recurse=yes'))">
    <xsl:result-document href="Output/{substring-after(document-uri(.), $dir)}"/>
       <xsl:apply-templates select="."/>

You may have to tweak the code that allocates an output file name based on the input file name.

You can invoke the new stylesheet using the options -it:main and dir=Input on the command line.

Michael Kay

Thanks a lot

Lodewijk Nollet

Kind regards - Met vriendelijke groeten

Lodewijk Nollet |
Agfa HealthCare
Documentation Author | HE/Documentation team 1
T  +32 3444 7603 | F  +32 3444 8401

Agfa HealthCare NV - Gent, Moutstraat 100, 9000 Gent, Belgium

R.O.: Septestraat 27, B-2640 Mortsel, Belgium | RLE Ghent | VAT BE 0426.312.921 | IBAN BE95570125275558 | Citibank International PLC, B-1050 Brussels
Click on link to read important disclaimer:

Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!

saxon-help mailing list archived at