-
-
Notifications
You must be signed in to change notification settings - Fork 273
Closed
Labels
Description
Description of the Problem
Given this XML document:
<I><A/><B/></I>
and XPath Query
//B/reverse(tail(reverse(subsequence(//*/has-children(), 3))))
BaseX returns one element false.
Expected Behavior
Should return empty result set. For node B, //*/has-children() selects the result of I, A, B three nodes. Applying subsequence(s, 3) selects only the last element, and after application of tail function no result should be selected. In terms of number of results returned, the two reverse() operations seems redundant in this case. If deleted BaseX returns the expected results.
Steps to Reproduce the Behavior
- Create database
create database db <I><A/><B/></I> - Execute XPath query
xquery //B/reverse(tail(reverse(subsequence(//*/has-children(), 3))))
This is a reduced test case from:
- Create database
create database db <I><A><B><C/></B></A><D/></I> - Execute XPath query
xquery //D/reverse(tail(reverse(subsequence(./preceding::*/has-children(), 3))))
Do you have an idea how to solve the issue?
No response
What is your configuration?
BaseX version: BaseX 10.7 beta latest commit 564bd39 on Windows