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

RE: AW: how to "save" a context?

Subject: RE: AW: how to "save" a context?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 21 Jan 2003 03:03:23 -0800 (PST)
RE: AW:  how to "save" a context?
> It would certainly be possible in principle to optimize the execution

> of count(preceding::node()), whether it's evaluated during index
> construction or later, but I think you'll be lucky to find a
processor
> that does it. In general, executing this expression on N nodes will 
> have O(N^2) performance. The approach using dynamic evaluation will 
> have O(N) performance, so it will win in the end.
> 
> I think it's likely that on most documents, counting the number of
> preceding-siblings at each level is likely to be significantly more
> efficient than counting all preceding nodes. So (for elements at any
> rate), why not use
> 
> <xsl:number level="multi" count="*"/>
> 
> giving an identifier such as 1.3.24.6, which can then be used to 
> locate the node using a recursive descent of the tree, using
> 
>   child::*[position() = substring-before($nr, '.')]
> 
> to select the right node at each level.


Absolutely right.

Based on this isn't it a good idea to have in XSLT/XPath a 
persistent-id() function and from-id() function?

As we see, this will eliminate (I hope almost completely) the need for
the xx:evaluate() extension function. 




=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 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.