Re: [xsl] Performance tips to speed up multiple transforms

Subject: Re: [xsl] Performance tips to speed up multiple transforms
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 05 Nov 2010 15:15:02 -0400
Hi,

Yes, there are a million ways to do this that don't require invoking a new JVM every time. (I exaggerate but only slightly.)

At 02:46 PM 11/5/2010, Rich wrote:
You could write a small Java app to do this all at once, but it turns out Saxon has a command line way to do this very efficiently:

http://www.saxonica.com/documentation/using-xsl/commandline.html

This will take a directory as a source argument, and process all the files in it with the same XSLT file. I think you might have to separately write your secondary output files using the xsl:result-document instruction, rather than just the default standard output to do what you want.

Actually this should work just fine without having to use xsl:result-document. IIRC, the output files are named after the input files and placed into a directory designated on the command line.


Other methods:

* IDEs such as oXygen and Qutoric's CoherentWeb will run transformations in batches (they can be very big batches)

* Try a more lightweight Java environment such as Andrew Welch's Kernow for Saxon (http://kernowforsaxon.sourceforge.net/)

* Andrew also has documented a Saxon-based method to get around the parse-it-all-into-memory overhead when running on a batch, which you can code into a stylesheet: see http://ajwelch.blogspot.com/2006/11/using-collection-and-saxondiscard.html

* Apache Ant

* XProc

There are more I can't remember at the moment.

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread