Project

Profile

Help

Bug #5194

closed

"except" operator not working correctly within anonymous function body

Added by Martin Honnen almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
XPath conformance
Sprint/Milestone:
Start date:
2021-12-29
Due date:
% Done:

100%

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

Description

Found by Dimitre on the XSL list:

Saxon 10.6 HE and SaxonCS give the result <?xml version="1.0" encoding="UTF-8"?><a/><c/><b/><b/>

for the code let $xml := parse-xml('<t><a/><b/><c/></t>'), $nodes := ($xml/*/a, $xml/*/c, $xml/*/b, $xml/*/b) return $nodes => fold-left((), function($all, $this) {$all, $this except $all})

e.g.

java -cp "C:\Program Files\Saxonica\SaxonHE10-6J\saxon-he-10.6.jar" net.sf.saxon.Query -qs:"let $xml := parse-xml('<t><a/><b/><c/></t>'), $nodes := ($xml/*/a, $xml/*/c, $xml/*/b, $xml/*/b) return $nodes => fold-left((), function($all, $this) {$all, $this except $all})"
<?xml version="1.0" encoding="UTF-8"?><a/><c/><b/><b/>

gives that result

Please register to edit this issue

Also available in: Atom PDF