This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 8762 - [XPath 2.1] Ambiguity of occurrence indicators in FunctionTest
Summary: [XPath 2.1] Ambiguity of occurrence indicators in FunctionTest
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 09:10 UTC by Michael Kay
Modified: 2010-02-17 22:39 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2010-01-15 09:10:45 UTC
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) *
Comment 1 Michael Kay 2010-01-15 09:42:56 UTC
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.
Comment 2 Jonathan Robie 2010-02-17 22:38:04 UTC
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.
Comment 3 Jonathan Robie 2010-02-17 22:39:28 UTC
(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