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

Re: How should I structure a huge XSLT dataset best?

Subject: Re: How should I structure a huge XSLT dataset best?
From: Kevin Jones <kjones@xxxxxxxxxxx>
Date: Tue, 30 Sep 2003 10:22:51 +0100
xslt huge dataset
On Monday 29 September 2003 21:32, Anthony Zawacki wrote:
> The lack of obvious precendence for this type of work makes it
> much more difficult.  I'm used to being able to search the
> list or looking at the XSLT FAQ and seeing easy solutions, but
> this type of issue doesn't seem to have been addressed in the
> past.  Or am I missing something?

We have a client that has a similar setup, large data sets 
contained in the stylesheet. They typically store the data in a 
variable and access it directly from there. The problem with 
this approach is that the processor will normally bind the 
variable to this data by creating a result tree fragment from 
its contents at runtime. For large data sets this can be 
expensive. Our processor can recognise if the variable content 
is constant and if so it effectively binds the variable at 
compile time eliminating this problem.

A more general solution is to just put your data in the 
stylesheet as a child of the <xsl:stylesheet> under a different 
namespace. In which case you can access it via a 
document('')/xsl:stylesheet/mydata:data type XPath. If the data 
is to be imported from a second stylesheet you would need to use 
its name in the document() function. The performance of this 
technique relies on the processor keeping the stylesheet object 
model(s) in memory after compilation and recognising that you 
are referring to the same document. This is not always true but 
most processors appear to work that way.

As to the structure of your data, is this not a search problem a 
trie is ideally suited to. If this is the case you may be able 
to generate XSLT to perform the search directly without the need 
for a data table. Trie's can be encoded into a set of nested 
switch statements triggering on each character in the test 
string. This is most likely the quickest solution and avoids the 
issues of the other options above.

Regards,
Kev.





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


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.