xsl-list
[Top] [All Lists]

Re: [xsl] Determine position in node sequence based on criteria

2010-06-30 09:19:39
Agreed. It seems like it would be real handy to have position() take
an argument:

 position(../s[])

and return the position of the matching items...

did my count preceding-sibling suggestion not fit?

or have a different
function where you could get the position in a for expression:

for $i in ../s
 if (...) then $i/position() else ()

In xquery you do

for $i at $pos in ../s return
 if (...) then $pos else ()

However thats exactly the same as:

for $i in ../s return
 if (...) then 1 + count($i/preceding-sibling::s) else ()


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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