File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XSL Transformation Speed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL Transformation Speed" Watch "XSL Transformation Speed" New topic

XSL Transformation Speed

Paul Morano

Joined: Jun 18, 2003
Posts: 7
I am doing an XSL transformation from XML->XML and find it is very slow. Granted, I do have a very large <xsl:for-each> section that can produce varying sizes depending on the input XML.
Is there some way I can speed up XSL transformations? Maybe some guidelines to follow?
I have tried the following but with little speed improvements:
Using a Templates Object.
Limiting use of // (descendant axes)
Optimizing Variable Creation (e.g. <xsl:variable name="fooElem" select = "foo" />
Any suggestions are appreciated.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Which toolkit are you using? I understand there are vast differences in speed for various types of problem. Here is a benchmark I found, rather out of date.
Tony Yan
Ranch Hand

Joined: Apr 10, 2002
Posts: 170
Can you post your xsl?
Another thing, if you have a lot of wild cards (*) or testing (test="a='xyz'"), things can be slowed down dramatically.

Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
I agree. Here's the link:
subject: XSL Transformation Speed
It's not a secret anymore!