On 12/03/2013, Mike Dalessio <[email protected]> wrote:
> I've opened a bug report here:
>
>     https://bugzilla.gnome.org/show_bug.cgi?id=695699
>
> The summary is that behavior of `position()` under 2.9.0 is different than
> under 2.8.0 and other major XML libraries (e.g., javax.xml.xpath).

The 2.9 behaviour looks correct to me.

Given your sample document in the bug report, the logic is as follows:

    //foo[position() = 1]
        '//foo' selects (foo, foo, foo, foo)
        the predicate picks out the first foo

    //*[position() = 1 and self::foo]
        '//*' selects (root, foo, foo, foo, foo)
        on root, the predicates evaluates as [1 = 1 and ()] -> false
        on the first foo, it evaluates as [1 = 2 and (foo)] -> false
        and so on, so no node matches

> Please take a look at the bug report and let me know if any further
> information is necessary?

Which other xpath implementations did you try exactly? I'm curious
what saxon does.

Martin
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to