Re: [xml] xpath evaluation issue on 2.9.0

On 12/03/2013, Mike Dalessio <mike dalessio gmail com> wrote:
I've opened a bug report here:

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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]