[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|