Re: [xsl] Optimizing a XSLT

Subject: Re: [xsl] Optimizing a XSLT
From: Jeff Kenton <jkenton@xxxxxxxxxxxxx>
Date: Mon, 14 Apr 2003 14:35:21 -0400
Eric Barre wrote:
Hi,
I wrote a XSL file to transform a XML file to another XML file,
everything works fine on small file but eventually I will be using it
against large XML file (over 1mg).
When I run it against such a large file it takes for ever to return, I
mean I have to kill it after running for an hour.
Is there a way to optimize the XSL that I have to make it perform
better?
Here is the 'input' XML:
...
The XSL:
...
After reading some posting I tried to stay away from the <xsl:for-each>
as much as possible as well as using variables and parameters.
If anyone could let me know a way to optimize this I would appreciate
it.

The only thing I notice is that almost any use of disable-output-escaping is usually a sign of "doing things the hard way". I would recommend removing all of them in favor of using XSLT to generate your XML the way it was intended to be done.


Having said that, it's probably not the cause of your speed problems. Some XSLT processors are just faster than others. One Meg is not that huge an input file -- my guess is that a decent XSLT engine should handle it in under 1 minute. Try a different engine.


--


--------------------------
Jeff Kenton
DataPower Technology, Inc.
Wire Speed XSLT Processing



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread