performance of copying all source to result
I use an XSL stylesheet to copy (almost) all the source document to the result, doing some small modifications on a small portion of the elements. The stylesheet I use is similar to the one posted in http://www.dpawson.co.uk/xsl/N1930.html#N15209 (It is added in the end of this message). Basically, it goes over all nodes. My source documents are relatively small (1 KB - 4 KB). The question is - how long will it take (at run-time) to do this transformation? My measurements show it will be more then 1.6 seconds (1600 milliseconds). I compared some combinations of the following XSLT processors: Xalan2, Xalan1.2, Saxon 6.0.2, XT and the following parsers: Xerces, XP, Sun, Aelfred. I run several times (the first time always takes more, about 4 seconds). I use the compiled stylesheet. The results were all between 1.6 seconds and 2.1 seconds. But I would like to get a result of about 0.5 seconds for a transformation. Therefore I suspect it is the stylesheet that should be improved, not the XSLT processor. Any suggestions? Evyatar. The stylesheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match=" a | applet | b | big | body | br | caption | cite | code | col | colgroup | dd | div | dl | dt | em | font | form | frame | frameset | head | h1 | h2 | h3 | h4 | h5 | h6 | hr | html | i | iframe | img | link | li | map | meta | noframes | ol | p | param | pre | s | script | small | span | strong | style | sub | sup | td | th | title | tr | tt | ul | var | table "> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <!-- ADD YOUR template here --> </xsl:output> </xsl:stylesheet> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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