[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Multiple file XSL conversion

Subject: RE: Multiple file XSL conversion
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 28 Jun 2005 21:00:51 +0100
perl file xsl
If the transformations are independent of each other, then it's best to
invoke the stylesheet once for each document, rather than doing it all in a
single transformation, because the XSLT processor is otherwise likely to try
and hold all the documents in memory.

So you need some kind of application program to invoke the transformation.
You haven't explained what environment you're using: in Java, you would use
the JAXP API to compile the stylesheet once into a Templates object, and
then go into a loop:

for (int i=0; i<files.length; i++) {
  transformer = templates.newTransformer();
  transformer.transform(new StreamSource(files[i]), new StreamResult(....));
}

If it's a one-off job you could do it from shellscript, but that would be
much less efficient.

I've just remembered that on Saturday in Prague I heard Petr Pajas
describing his XML Editing Shell XSH, which looks like a good tool for this
kind of job - I haven't tried it though. See http://xsh.sf.net/ It's fairly
heavily Perl-based so you'll probably like it most if you're already a Perl
user.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Andrew Borsz [mailto:andrew@xxxxxxxxxxxxxxx] 
> Sent: 28 June 2005 20:53
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Multiple file XSL conversion
> 
> Hello,
> I'm trying to figure out a good way to convert multiple XML files at 
> the same time. Does anyone know the best way to take hundreds XML 
> documents and transform them all with the same XSL stylesheet 
> in one or 
> two steps?
> 
> Any advice would be appreciated.
> 
> Thanks,
> 
> Andrew Borsz

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.