W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2001

RE: xslt 1.1

From: Matthew Bentley <matthew.bentley@brookers.co.nz>
Date: Wed, 31 Jan 2001 15:07:43 -0500 (EST)
Message-ID: <A3BEF7539574D4119E61001083F94D780F3244@WELBKSEMS02>
To: "'mhkay@iclway.co.uk'" <mhkay@iclway.co.uk>
Cc: xsl-editors@w3.org
> > There is needed, ...
> > the ability for position() to take a node as an argument, and
> > return the -relative- position.
> > For example:
> > <xsl:value-of select="position(following-sibling::truck[1])" />
> >
> > would return: "3"
> 
> The result, of course, is a function not only of the target 
> node, but of the
> axis by which it was reached; and presumably it would count 
> all nodes along
> that axis (including comments), rather than merely counting elements?

Thats correct, yes.

> Defining such a function would get very complex and might 
> well give answers
> that were intuitively wrong in many cases.
> I think a much more general capability is the idea of a 
> "truncated axis", so
> you could select the node-set
> 
> leading(following-sibling::*, [not(self::truck)])
> 
> which selects all following sibling elements up to the first 
> one that is a
> <truck>, and then you can do count() on this to get your position()
> function.

Sounds good - even more suited to what I'm doing than my suggestion :) Out
of interest, how would the above idea create intuitively wrong answers?
Thanks,
Matt


Received on Sunday, 4 February 2001 10:08:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT