From: Efraim F. <efr...@gm...> - 2012-04-24 21:10:45
|
Hi, On 04/24/2012 10:56 AM, Gunther Rademacher wrote: > Efraim Feinstein wrote >> It looks like there is then no way to uniquely specify "zero or >> one functions returning exactly one item." >> > That's what a ParenthesizedItemType is for: > > (function() as item())? > > Also note that the 3.0 spec has an "extra-grammatical constraint" on > occurrence indicators covering this: > > http://www.w3.org/TR/xquery-30/#parse-note-occurrence-indicators > Thanks! That would seem to solve the problem from the spec's perspective. As far as I can tell, the syntax is not supported in eXist (as of 2.0 preview r16247). (Example test code: xquery version "3.0"; declare function local:f($a as (function() as xs:string)?) { if (exists($a)) then $a() else "b" }; local:f(()) ) -- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org |