Re: [xsl] using position() inside Muenchian groups?

Subject: Re: [xsl] using position() inside Muenchian groups?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Oct 2008 21:28:43 -0400
At 2008-10-15 12:07 +1100, Eric Scheid wrote:
> There is an instruction that by definition works on axes and not on
> the current node list:  <xsl:number/>  ... but it is designed for
> exposing tree positions in formatted results, I very rarely find a
> need to use it in a "programming style" within my code logic.  I do
> find my students quickly resort to using <xsl:number/> when
> position() is better, but in your case position() is *not* better.

Ah, nice one. Googling the documentation of xsl:number would never have
suggested this solution to me. So, to understand correctly, <xsl:number/>
reports the original position in the source elements, while position()
reports the position in the *selected* sub-set of nodes/elements?

Yes, that is it ... though <xsl:number/> works on the entire source tree not just elements.

If you want more details on <xsl:number/> (it is a very powerful construct) that happens to be the subject of the YouTube excerpted sample lesson of our five-day hands-on class recorded as a 24-hour interactive hyperlinked XSLT/XPath 1.0/2.0 training DVD:

Of course the YouTube bit isn't hyperlinked ... so to see how that works there is a download of a "test lesson" that demonstrates the hyperlinking to each slide:

The DVD runs on Linux (with Totem), Macintosh and Windows platforms, but I ask prospective buyers to try the above test video first to ensure the format will run on their platform.

An overview of the entire class is also posted as a YouTube excerpt:

I've been very excited with the feedback from our video customers.

I hope this helps.

. . . . . . . . . . Ken

Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:
Video course overview:
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
Male Cancer Awareness Nov'07
Legal business disclaimers:

Current Thread