Closed Twilight-Shuxin closed 1 year ago
True, and fixed. The reason for the unexpected error message (and the previous one) was that arithmetic expressions are simplified at compile time:
//A1[(text() * 2) = 6]
→ //A1[text() = 6 div 2]
→ //A1[text() = 3]
In the latest snapshot, I have restricted the rewriting rules to positive numbers excluding 0.
Thanks!
Description of the Problem
Given this XML document:
and XPath Query
BaseX throws the exception
Expected Behavior
Should not throw exception but execute successfully and return empty result set as Saxon & Exist DB since no division operation is involved.
Steps to Reproduce the Behavior
Using BaseX Client:
create database test
put test.xml path/to/file
xquery //A1[(text() * 0) = 6]
(Note: Directly executing<A1 id="1">-1</A1>//A1[(text() * 0) = 6]
does not trigger the bugDo you have an idea how to solve the issue?
No response
What is your configuration?
BaseX version: 10.4 on Windows (Also reproduced on the latest stable snapshot 10.5 provided in https://files.basex.org/releases/latest/)