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

Re: Specify/determine element's "logical" parent

Subject: Re: Specify/determine element's "logical" parent
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 23 Sep 2004 22:05:11 +0100
xsl key hash
Hi John,

It would certainly be easiest to use the parentid attribute. To do
that, all you have to do is set up a key that indexes the <item> elements based on their id attribute:

This data structure could be very large; would this have a performance impact (hashing or whatever the entire document) or would it just hash or whatever the keys when it needs them? If so, is it possible (in ASP.NET) to share these keys in memory for the entire application, or will these be processed each time this XSL is invoked? Sorry if this does not makse sense; I am somewhat new to XSL and .NET and have never worked with XSL key.

In most (good) XSLT implementations, a hash table for the key will only be generated when/if the key() function is first invoked, and that hash table will be around for the remainder of the transformation. Using a key is usually faster than using an equivalent path (and much faster than trying to interpret an XPath using XSLT). The only thing you really have to worry about if you're using keys with a large document is how much memory the key's hash table will take up.


I don't know details of ASP.NET, but keys are bound to single transformations and as such they won't be cachable across invocations of a stylesheet. If you run into performance problems, you might have more luck from an XQuery implementation, since they're designed to work with databases in which permanent indexes are possible.

Cheers,

Jeni
--
Jeni Tennison
http://www.jenitennison.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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