2009/8/11 Ben Stover <bxstover(_at_)yahoo(_dot_)co(_dot_)uk>:
When reading web page
http://www.saxonica.com/documentation/using-xsl/commandline.html
then there is said about the parameter "-s":
"If the name identifies a directory, all the files in the directory will
be processed individually."
Does that mean all files just in this directory?
What about files in sub-directories? Are they processed as well?
If not: How can I tell Saxon to process a whole directory tree recursively?
If you want 1 output file per input file, then you could use Kernow or
the technique below. If you want 1 output for multiple input files,
then use the collection() function in a "standalone" transform (and
then run that using Kernow :)
<xsl:template name="main">
<xsl:for-each select="for $x in collection(concat($input-dir,
'?select=*.xml;recurse=yes')) return saxon:discard-document($x)">
process each file
The "recurse=yes" part tells Saxon to process sub-directories too.
The "saxon:discard-document()" part is needed if you have a to process
more XML in a single transform than you can fit into memory.
I use this so often I really hope there are new features in 2.1 for
processing directories of XML.
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--