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

Re: Correcting a prior error

Subject: Re: Correcting a prior error
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 30 Jul 2010 16:54:56 +0100
Re:  Correcting a prior error
On 30/07/2010 16:43, Wendell Piez wrote:
At 05:44 AM 7/30/2010, Dave wrote:
Or change this to count(ancestor::*|preceding::*) + 1?

Or count(ancestor-or-self::*|preceding::*)


Or count(.|ancestor::*|preceding::*) ... :-)


Or count(ancestor::*) + count(preceding::*) + 1 to avoid the cost of unnecessarily sorting into document order, merging the lists, and eliminating the non-existent duplicates. (That's one reason I suggested xsl:number. Another, more important, is that in Saxon, xsl:number is optimized so that when you make repeated calls with the same attributes to number successive nodes, Saxon doesn't count all the nodes from the beginning of the document each time, it only counts back to the most recently numbered node).


Michael Kay
Saxonica

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.