This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Gunther Rademacher <grd@gmx.net> asked me to raise this: he reported difficulty registering for bugzilla. <quote> The addition of FunctionTest to the sequence type syntax causes an ambiguity for occurrence indicators, because the grammar allows an optional occurrence indicator both at the end of a FunctionTest, and following a FunctionTest. Though the occurrence-indicators constraint assigns them precedence over other uses of the respective symbols, I can't see that it regulates the FunctionTest problem - both alternatives clearly would provide the SequenceType context (hope I didn't miss something...). </quote> MHK observation: The spec says "It is permitted to use parentheses to enclose item types, in order to resolve ambiguities that could arise from the OccurrenceIndicator of a SequenceType." - but it doesn't say what the interpretation is if you don't use parentheses. It should make it clear that function () as xs:string * means function () as (xs:string *) rather than (function () as xs:string) *
Incidentally, I think it's generally a good idea to provide explicit syntax for a default, and we have no explicit syntax for an occurrence indicator of "exactly one". I would propose using xB9, superscript one, for this purpose. Going to non-ASCII characters is a departure, I know, but it's 2010 and we're all grown up now. (function($a as xs:stringĀ¹) as xs:integerĀ¹)* feels good to me.
The Working Group has decided to solve this by adding an extra-gramatical constraint, similar to Constraint: occurrence-indicators. I will illustrate it with an example from this bug report.
(In reply to comment #2) > The Working Group has decided to solve this by adding an extra-gramatical > constraint, similar to Constraint: occurrence-indicators. I will illustrate it > with an example from this bug report. I neglected to mention that this decision was made in the following meeting: Teleconference #424, 2010-01-26 http://lists.w3.org/Archives/Member/w3c-xsl-query/2010Jan/0142.html