Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: XPath Ambiguity
07-25-2007, 12:21 PM #1
I am currently working on an XPath engine written in C++.
Consider the following XML fragment:
<node> <item id="1">Hello World!</item> <node> <item id="2">Hello Mars!</item> </node> </node>
Firstly, it could return one copy of item 1 and two copies of item 2, because item 2 is reachable in two ways using the xpath query given.
Secondly, it could return one copy of item 1 and one copy of item 2 because the two paths to item 2 both terminate at the same XML object.
It is easy for me to implement either behaviour in the C++, and both behaviours are logically correct, but the question is, which behaviour is generally considered to be "preferentially" correct?