Actions
Bug #4497
closedWrong default type for tuple fields in the Saxon 10 documentation.
Start date:
2020-03-24
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
10
Fixed in Maintenance Release:
Platforms:
Description
In the Saxon 10 documentation, it states that if an as
clause is absent then the type of that field is item()*
instead of item()+
. The current wording would (according to condition 2) permit the field to be absent (as it would allow the empty sequence).
The other parts of the documentation also mention that the fields are optional by default (e.g. the paragraph before the conditions).
The XQuery processor is behaving as if the fields are required (not optional) by default, as:
let $c as tuple(x, y) := map { "x": 2, "z": 3.5 }
return $c
gives the error:
[XPTY0004] The required item type of the value of variable $c is tuple(x: item()+, y: item()+); the supplied value map{"x":2,"z":3.5} does not match. Field y is absent; it must have a value
at test.xq:1:26
Please register to edit this issue
Actions