xsl-list
[Top] [All Lists]

Re: [xsl] Correcting a prior error

2010-07-30 11:29:59
At 11:54 AM 7/30/2010, Mike wrote:
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).

This little bit of information about Saxon is very useful!

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--