To basex developers,
The following xquery returns 464 <persName> elements with saxonHE but fails to produce any <persName> elements when the query is run in basex (6.1.3).
for $RT in ("c31a") let $theseRecs := //c31a[sourceVol="CON 31/2"] let $ctr := count($theseRecs) let $pList := <listPersName n="{$ctr}">{ for $p at $i in $theseRecs let $conref := if ( $RT = "c37v" ) then <hi/> else () return <persName id="{$p/@xml:id}">{$i}</persName> }</listPersName> return ( $pList,<hello/> )
If the xquery null sequence () in line 6 is changed to an empty string: else "" I get the expected 464 results. With () in the else I get only this:
<listPersName n="464"/> <hello/>
I had a devil of a time detecting this. I also have encountered bad behaviour when running queries against attributes which exist but have no value, like this:
<el attr="">
In Saxon I can search for //el[@attr=""] and get results but basex does not find these cases.
Hoping these bugs can be quickly squashed.
regards,
Sandra
Sandra,
thanks for your profound feedback, which is always valuable. Your bugs should now be fixed; please try: http://www.basex.org/maven/org/basex/basex/6.1.4
The following xquery returns 464 <persName> elements with saxonHE but fails to produce any <persName> elements when the query is run in basex (6.1.3).
I could break down the problem to the following query…
for $a in 1 let $b := () return $a
…in which the FLWOR clause was optimized away. We didn't notice this bug before as the optimization worked well on queries like the following:
let $a := 1 let $b := () return $a
for $a in 1 for $b in () return $a
I had a devil of a time detecting this. I also have encountered bad behaviour when running queries against attributes which exist but have no value, like this:
<el attr="">
Yep… The index now remembers empty strings as well. Please rebuild your indexes to get this one working.
All the best, Christian
basex-talk@mailman.uni-konstanz.de