Project

Profile

Help

Bug #6093

closed

Bug on predicate with last()

Added by Shuxin Li over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2023-06-23
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

With xml document:

<A><B/></A>

and xpath query

//*[((.,.)/parent::*/last() ! (. > 1)) = true()]

Saxon-he 12.2 returns node B. From my understanding node B shouldn't be selected, for (., .)/parent:: selects node A, and last() for node A in this case should evaluate to 1, which does not satisfy the requirement. The same query in BaseX returns empty result set.

However I'm not very certain about either what the context actually should be here or what the last() function should really return. Might this be undefined behavior?

This is a reduced case from:

<A><B><C/></B><D/></A>

and

//*[((C,.)/following::*/last() ! (. > 1)) = true()]

Please register to edit this issue

Also available in: Atom PDF