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

Re: Sorting using helper structure, position(), xsl:ke

Subject: Re: Sorting using helper structure, position(), xsl:key
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Wed, 16 Apr 2008 13:07:01 +0200
Re:  Sorting using helper structure
Abel Braaksma schrieb:
Michael Ludwig wrote:
You must use a variable in this case, which, of course, is
unfortunate if the node-set to search is large.

I'd be surprised if you could find a single XSLT processor that actually makes a deep copy of the full tree. A simple test with several variables pointing to the root node of several large documents shows no increase in internal memory usage compared to using only one variable per document. In other words: use as many variables as you like.

I don't think we disagree. As far as I've understood, a variable in XSLT 1.0 is just a pointer as long as you use @select instead of element content. The former method never involves copying, the latter may well do so. So I tend to use the former approach wherever I can, and I do not think memory consumption is a concern here. It's just a named @select.

What I was referring to is the case of a large node-set, say, 300
nodes, which you have to repeatedly search, say, at each of 300
iterations. I've seen a significant speed-up using key('bla', @id)
versus $bla[@id = current()/@id], which is, I think, one of the reasons
why keys exist.

And also the reason I wrote "unfortunate" in the above quote.

Best regards,


Current Thread


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.
First Name
Last Name
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.