Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, Jens Erat » web: www.jenserat.de » email: jens.erat@uni-konstanz.de » phone: 0151 56961126 » weitere und aktuelle Kontaktmöglichkeiten: www.jenserat.de/kontakt
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Jens,
thank you for your immediate reply. Is this kind of evaluation specific to BaseX? All other XQuery/XPath processors I know don't require parenthesis to produce the result I expect. Usually, a predicate is part of the location step. On the descendant axis, all selected nodes are numbered in depth first order and position() evaluates to the number of the context node. Thus, /descendant::c[1] should return the first c node because there is only one node with position number 1.
Best regards, Martin
Am 09.11.2010 22:25, schrieb Jens Erat:
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, *Jens Erat*
* » *web:* www.jenserat.de <http://www.jenserat.de> * » *email:* jens.erat@uni-konstanz.de <mailto:jens.erat@uni-konstanz.de> * » *phone:* 0151 56961126 <callto:+4915156961126> * » weitere und aktuelle *Kontaktmöglichkeiten:* www.jenserat.de/kontakt <http://www.jenserat.de/kontakt>
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de mailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Just tried Saxon myself and you're right. If you evaluate
let $doc := <a>
<b> <c/> </b> <b> <c/> </b> </a> return $doc/descendant::c[1]
only one result node is returned, too. Maybe I've been a bit too fast after a glass of good wine...
We will have another opinion soon I think... Jens Erat » web: www.jenserat.de » email: jens.erat@uni-konstanz.de » phone: 0151 56961126 » weitere und aktuelle Kontaktmöglichkeiten: www.jenserat.de/kontakt
Am 09.11.2010 um 22:58 schrieb Martin Gieseking:
Hi Jens,
thank you for your immediate reply. Is this kind of evaluation specific to BaseX? All other XQuery/XPath processors I know don't require parenthesis to produce the result I expect. Usually, a predicate is part of the location step. On the descendant axis, all selected nodes are numbered in depth first order and position() evaluates to the number of the context node. Thus, /descendant::c[1] should return the first c node because there is only one node with position number 1.
Best regards, Martin
Am 09.11.2010 22:25, schrieb Jens Erat:
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, *Jens Erat*
» *web:* www.jenserat.de http://www.jenserat.de
» *email:* jens.erat@uni-konstanz.de mailto:jens.erat@uni-konstanz.de
» *phone:* 0151 56961126 callto:+4915156961126
» weitere und aktuelle *Kontaktmöglichkeiten:* www.jenserat.de/kontakt http://www.jenserat.de/kontakt
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de mailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Martin,
thanks for your feedback. Indeed that's a (pretty new) bug, which seems to be caused by the query compiler: your query is rewritten to
/*:a/*:b/*:c[position() = 1]
which should never happen if a position predicate is specified. Kinda surprising that none of the test cases stumbled across this issue.
Be sure this will be fixed pretty soon.
Best, Christian
On Tue, Nov 9, 2010 at 10:58 PM, Martin Gieseking martin.gieseking@uos.de wrote:
Hi Jens,
thank you for your immediate reply. Is this kind of evaluation specific to BaseX? All other XQuery/XPath processors I know don't require parenthesis to produce the result I expect. Usually, a predicate is part of the location step. On the descendant axis, all selected nodes are numbered in depth first order and position() evaluates to the number of the context node. Thus, /descendant::c[1] should return the first c node because there is only one node with position number
Best regards, Martin
Am 09.11.2010 22:25, schrieb Jens Erat:
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, *Jens Erat*
* » *web:* www.jenserat.de http://www.jenserat.de * » *email:* jens.erat@uni-konstanz.de mailto:jens.erat@uni-konstanz.de * » *phone:* 0151 56961126 callto:+4915156961126
* » weitere und aktuelle *Kontaktmöglichkeiten:* www.jenserat.de/kontakt http://www.jenserat.de/kontakt
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de mailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Christian,
thanks for your confirmation. I'm glad to hear you already found the origin of the issue and that you will fix it soon.
Best regards, and thank you for the great application. Martin
Am 09.11.2010 23:04, schrieb Christian Grün:
Hi Martin,
thanks for your feedback. Indeed that's a (pretty new) bug, which seems to be caused by the query compiler: your query is rewritten to
/*:a/*:b/*:c[position() = 1]
which should never happen if a position predicate is specified. Kinda surprising that none of the test cases stumbled across this issue.
Be sure this will be fixed pretty soon.
Best, Christian
On Tue, Nov 9, 2010 at 10:58 PM, Martin Gieseking martin.gieseking@uos.de wrote:
Hi Jens,
thank you for your immediate reply. Is this kind of evaluation specific to BaseX? All other XQuery/XPath processors I know don't require parenthesis to produce the result I expect. Usually, a predicate is part of the location step. On the descendant axis, all selected nodes are numbered in depth first order and position() evaluates to the number of the context node. Thus, /descendant::c[1] should return the first c node because there is only one node with position number
Best regards, Martin
Am 09.11.2010 22:25, schrieb Jens Erat:
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, *Jens Erat*
* » *web:* www.jenserat.de<http://www.jenserat.de> * » *email:* jens.erat@uni-konstanz.de <mailto:jens.erat@uni-konstanz.de> * » *phone:* 0151 56961126<callto:+4915156961126> * » weitere und aktuelle *Kontaktmöglichkeiten:* www.jenserat.de/kontakt<http://www.jenserat.de/kontakt>
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de mailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Martin,
we've just fixed the (somewhat embarassing) bug; feel free to tell us if you need a jar snapshot. Otherwise, you'll find the fix in the SVN repository and in the next minor release.
Thanks again, Christian
On Tue, Nov 9, 2010 at 11:20 PM, Martin Gieseking martin.gieseking@uos.de wrote:
Hi Christian,
thanks for your confirmation. I'm glad to hear you already found the origin of the issue and that you will fix it soon.
Best regards, and thank you for the great application. Martin
Am 09.11.2010 23:04, schrieb Christian Grün:
Hi Martin,
thanks for your feedback. Indeed that's a (pretty new) bug, which seems to be caused by the query compiler: your query is rewritten to
/*:a/*:b/*:c[position() = 1]
which should never happen if a position predicate is specified. Kinda surprising that none of the test cases stumbled across this issue.
Be sure this will be fixed pretty soon.
Best, Christian
On Tue, Nov 9, 2010 at 10:58 PM, Martin Gieseking martin.gieseking@uos.de wrote:
Hi Jens,
thank you for your immediate reply. Is this kind of evaluation specific to BaseX? All other XQuery/XPath processors I know don't require parenthesis to produce the result I expect. Usually, a predicate is part of the location step. On the descendant axis, all selected nodes are numbered in depth first order and position() evaluates to the number of the context node. Thus, /descendant::c[1] should return the first c node because there is only one node with position number
Best regards, Martin
Am 09.11.2010 22:25, schrieb Jens Erat:
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, *Jens Erat*
* » *web:* www.jenserat.dehttp://www.jenserat.de * » *email:* jens.erat@uni-konstanz.de mailto:jens.erat@uni-konstanz.de * » *phone:* 0151 56961126callto:+4915156961126
* » weitere und aktuelle *Kontaktmöglichkeiten:* www.jenserat.de/kontakthttp://www.jenserat.de/kontakt
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de mailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Christian,
wow, that was fast. Thanks! I'll check out the sources from svn tomorrow and will continue playing around with BaseX then. :)
Regards, Martin
Am 09.11.2010 23:22, schrieb Christian Grün:
Hi Martin,
we've just fixed the (somewhat embarassing) bug; feel free to tell us if you need a jar snapshot. Otherwise, you'll find the fix in the SVN repository and in the next minor release.
Thanks again, Christian
On Tue, Nov 9, 2010 at 11:20 PM, Martin Gieseking martin.gieseking@uos.de wrote:
Hi Christian,
thanks for your confirmation. I'm glad to hear you already found the origin of the issue and that you will fix it soon.
Best regards, and thank you for the great application. Martin
Am 09.11.2010 23:04, schrieb Christian Grün:
Hi Martin,
thanks for your feedback. Indeed that's a (pretty new) bug, which seems to be caused by the query compiler: your query is rewritten to
/*:a/*:b/*:c[position() = 1]
which should never happen if a position predicate is specified. Kinda surprising that none of the test cases stumbled across this issue.
Be sure this will be fixed pretty soon.
Best, Christian
On Tue, Nov 9, 2010 at 10:58 PM, Martin Gieseking martin.gieseking@uos.de wrote:
Hi Jens,
thank you for your immediate reply. Is this kind of evaluation specific to BaseX? All other XQuery/XPath processors I know don't require parenthesis to produce the result I expect. Usually, a predicate is part of the location step. On the descendant axis, all selected nodes are numbered in depth first order and position() evaluates to the number of the context node. Thus, /descendant::c[1] should return the first c node because there is only one node with position number
Best regards, Martin
Am 09.11.2010 22:25, schrieb Jens Erat:
Hi Martin,
the predicate gets evaluate for each result of the XPath-step. BaseX's output is expected.
The query you wanted to perform is (/descendant::c)[1] which only returns the first result over all.
Best regards, *Jens Erat*
* » *web:* www.jenserat.de<http://www.jenserat.de> * » *email:* jens.erat@uni-konstanz.de <mailto:jens.erat@uni-konstanz.de> * » *phone:* 0151 56961126<callto:+4915156961126> * » weitere und aktuelle *Kontaktmöglichkeiten:* www.jenserat.de/kontakt<http://www.jenserat.de/kontakt>
Am 09.11.2010 um 22:18 schrieb Martin Gieseking:
Hi,
while playing around with BaseX, I stumbled over some weird results in conjunction with positional predicates on the descendant axis. As far as I can see, there seems to be a bug in the evaluation of function position().
Example: When I load the following XML document and evaluate the path expression /descendant::c[1], both c element nodes are returned, but only the first one is expected. So, currently the result is identical to that of //c[1].
<a> <b> <c/> </b> <b> <c/> </b> </a>
Best regards, Martin _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de mailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de