Project

Profile

Help

Bug #5193

closed

$nodes => fold-left((), function($all, $this) {$all, $this except $all}) call gives error "Supplied value element <a> does not match required type xs:error in dynamic call of anonymous function (arity 2)"

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:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

In the "aftermath" of a lively discussion of node identity on the XSL list I tried to run some code through Saxon-JS 2.3 and found an odd error message when using the arrow operator and fold-left, when I run

xslt3 -xp:"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})"

I get an error

Error XPTY0004
    Supplied value element <a> does not match required type xs:error in dynamic call of anonymous function (arity 2)

The plain use of fold-left without the arrow operator, as in

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

works fine.

Please register to edit this issue

Also available in: Atom PDF Tracking page