From: Jason S. <js...@in...> - 2010-09-02 20:08:46
|
Benoit, eXist is long overdue for a 1.4.1 bugfix release. The /stable/eXist-1.4.1 branch seems to be - no surprise - stable. And it has lots (10 months worth) of fixes. Are you able to build the code, or are you committed to the 1.4.0 release? -----Original Message----- From: Benoit Mercier [mailto:Benoit.Mercier@USherbrooke.ca] Sent: Thursday, September 02, 2010 12:09 PM To: exi...@li... Subject: [Exist-open] Need help in understanding eXist Xquery results : eXist version Hi, I forgot to mention that I am using eXist 1.4.0-rev10438-20091111 Benoit ******************* I found a strange behaviour in XQuery evaluation by eXist. I cannot explain the difference between the results obtained via XQuery 1 and Xquery 2. Xquery 1 -------- let $xml := <test_document> <title>Is there a bug?</title> <metas> <meta> <name>error</name> <value>Should NOT return.</value> </meta> <meta> <name>correct</name> <value>Should return.</value> </meta> </metas> </test_document> return $xml//title[ends-with(.,"bug?")]/ancestor::test_document/metas//name[contains(.,"correct")] XQuery 1 result --------------- <name>correct</name> If you create an XML document (let's say "/db/tmp/test_document.xml") with the content of the $xml variable and execute the following XQuery, you get wrong results. But I might miss something... Xquery 2 -------- document("home/benoitm/test_document.xml")//title[ends-with(.,"bug?")]/ancestor::test_document/metas//name[contains(.,"correct")] XQuery 2 results ---------------- <name>error</name> <name>correct</name> To get correct results with XQuery 2, you have to add parenthesis like this : ( document("home/benoitm/test_document.xml")//title[ends-with(.,"bug?")]/ancestor::test_document/metas//name ) [contains(.,"correct")] It seems that the parent of the last predicate is wrong when evaluating without parenthesis. Am I misunderstanding something? Thank you in advance! Benoit (mercibe) |