XML Spy bug: predicate evaluation order

The Xpath 2.0 specification describes predicates and specifically predicate ordering with

“In the case of multiple adjacent predicates, the predicates are applied from left to right, and the result of applying each predicate serves as the input sequence for the following predicate.”

Unfortunately XML Spy seems to have a bug. Given the following example, again taken from the Xpath 2.0 spec:

<bib><book><title>TCP/IP Illustrated</title><author>Stevens</author><publisher>Addison-Wesley</publisher></book><book><title>Advanced Programming in the Unix Environment</title><author>Stevens</author><publisher>Addison-Wesley</publisher></book><book><title>Data on the Web</title><author>Abiteboul</author><author>Buneman</author><author>Suciu</author></book></bib>

The Xpath expression (evaluated from the root) of bib/book/author[. = "Stevens"][1] should evaluate to a single author element with the value “Stevens” – that is, it should, by the definition cited above, evaluate to the same thing as (bib/book/author[. = "Stevens"])[1]. Unfortunately it does not – the former evaluates to two author elements with the value “Stevens”, the latter evaluates to a single author element with the value “Stevens”.Bummer.I am running XML Spy version 2006, sp2 – Enterprise Edition.

September 25, 2006 Administrator XML, XPath No Comments

Share Your Thoughts