[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using paramter "-s" with a diretcory = recursive f
2009/8/11 Ben Stover <bxstover@xxxxxxxxxxx>: > 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|