>The idea was to have returned the position of the instance of C that was found 
>within it's parent.

That's not what the position() function does. To get the position of a node $N 
among the children of its parent, use

count($N/preceding-sibling::node())+1

position() used on the rhs of "/" returns the position of the context item 
among the items selected; it will always be an ascending sequence starting at 1.

Michael Kay
Saxonica


On 2 Jan 2014, at 13:21, Ihe Onwuka <[email protected]> wrote:

>  <A name="me"><B><C score="" /><D>some content</D></B><B><C score="44" 
> /><D>some content</D></B></A>/
>      descendant::C[normalize-space(@score)]/
>      <g>{<x name="{ancestor::A/@name}" position="{position()}"/>,.}</g>
> 
>  Now look what Saxon 9.3.0.5 gives for the position attribute
> 
> <g><x position="1" name="me"/><C score="44"/></g>
> 
> and eXist 3.0
> 
> <g>
> 
> <x name="me"  position="0"/>
> <C score="44"/>
> </g>
> 
> The idea was to have returned the position of the instance of C that was 
> found within it's parent. I'm not convinced either are doing that but it's a 
> nice to have for me not a core so I will report and leave it at that.
> 
> 
>  
> _______________________________________________
> [email protected]
> http://x-query.com/mailman/listinfo/talk

_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to