[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XSLT optimisation


Subject: [xsl] XSLT optimisation
From: Alexander Johannesen <alex@xxxxxxxxxx>
Date: Fri, 28 Mar 2003 17:10:53 +0100

Hi,

For my project (see .sig), which deals with rather big flat-
structured XML files (XTM topic maps), I'm reaching a phase where I'm about to look into some serious optimalisation of the code. I'm looking for the best tips and tricks for this. My examples are;


<xsl:variable name="topics" select="/topicMap/topic" />

which can contain several thousands of complex "topic" nodes. I
realise that both key() and <xsl:copy> are ways of improving
the speed of processing, but my knowledge of how to use them
is a bit flakey. Any good resources or suggestions on this? I
usually would use it as such;

<xsl:variable name="a-selection" select="$topics[starts-with(@id, 'some- text')]"
/>


And then either <xsl:for-each /> them, or otherwise use them in further XPath expressions. Another heavy-on-the-processing method I'm using is the similar;

<xsl:variable name="associations" select="/topicMap/association" />

which also can contain thousands of "association" nodes with lots of
sub-nodes. I perform quite complex XPath searches on this one, such as;

<xsl:variable name="currentID" select="'some-id'" />

  <xsl:variable name="theseOnes" select="$associations
        [instanceOf/topicRef/@xlink:href='#group-subgroup']
        [member/topicRef/@xlink:href=concat('#',$currentID)]
        /member[roleSpec/topicRef/@xlink:href='#child']
        /topicRef"/>

And some expressions even more complex than this, also including
recursive calling of the templates. (I guess it is hard to understand
all of this without seeing the full code)

One serious consideration I have is to move all of this processing
away from XPath (and xSLT) and use JavaScript (in a parser that
supports it) instead. The question is of course if the work I need
to do in order to get it all into JavaScript is worth it if there
are some good optimalisations of XSLT I can do first. :)

Anyways, I'm looking forward to any suggestions that you might have.


Kind regards,


Alexander
--
__________________ ________________________ ____________________________
                 |                        |
http://shelter.nu | alex at shelter dot nu | http://shelter.nu/xsiteable
__________________|________________________|____________________________

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



Current Thread
Keywords