W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2015

[Bug 27059] [xp3.1] Function coercion, maps and arrays

From: <bugzilla@jessica.w3.org>
Date: Thu, 16 Jul 2015 20:42:51 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-27059-523-eGmD5XPyug@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27059

--- Comment #5 from Jonathan Robie <jonathan.robie@gmail.com> ---
(In reply to John Snelson from comment #4)
> An example of function coercion against a map item to include in the spec:
> 
> let $m := map {
>   "Monday" : true(),
>   "Wednesday" : true(),
>   "Friday" : true(),
>   "Saturday" : false(),
>   "Sunday" : false()
> }
> let $days := ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
> "Saturday", "Sunday")
> return fn:filter($days,$m)

This returns:

[XPTY0004] xs:boolean expected, empty sequence found.

I would also like an example that filters, so I plan to provide both the
example above and this one:

let $m := map {
"Monday" : true(),
"Tuesday" : false(),
"Wednesday" : true(),
"Thursday" : false(),
"Friday" : true(),
"Saturday" : false(),
"Sunday" : false()
}
let $days := ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
"Saturday", "Sunday")
return fn:filter($days,$m)

=> 

Monday
Wednesday
Friday

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Thursday, 16 July 2015 20:42:53 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 16 July 2015 20:42:54 UTC