RE: xslt 1.1

> > 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 UTC