<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24501</bug_id>
          
          <creation_ts>2014-02-05 03:02:28 +0000</creation_ts>
          <short_desc>In General streamability, the maximum cardinality rule is ambiguous</short_desc>
          <delta_ts>2014-02-14 17:35:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.online</cc>
    
    <cc>cmsmcq</cc>
    
    <cc>innovimax+w3c</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>99733</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-02-05 03:02:28 +0000</bug_when>
    <thetext>Under 19.8.1 General Rules for Streamability (http://www.w3.org/TR/xslt-30/#general-streamability-rules), item 2.d.iii, we say the following:

&quot;If the posture of o is crawling and C is a function call of a function whose signature indicates a return type with a maximum cardinality of one (for example a call on head or exactly-one), then striding and the adjusted sweep of o.&quot;

This rule can only be applicable to built-in functions, or potentially extension functions of which the processor knows how they can be applied. For stylesheet functions, passing a node to a function without atomizing it is not allowed.

I think it is best if we simply list the group of &quot;functions with cardinality one&quot; to avoid confusion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99755</commentid>
    <comment_count>1</comment_count>
    <who name="Innovimax">innovimax+w3c</who>
    <bug_when>2014-02-05 08:27:13 +0000</bug_when>
    <thetext>function of maximum cardinality of one are function for which each call to ($x1, $x2, ...$xn) satisfies zero-or-one(f($x1, $x2, ...,$xn))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99769</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-05 11:18:56 +0000</bug_when>
    <thetext>I think the rules do work as written, though the reason why is quite subtle. If a call to a user-defined function allows nodes, then the argument that allows nodes will have a type-determined usage of navigation; under 1(b)(iii)(B) in the GSR it will therefore have an adjusted sweep of free-ranging. Rule 2(b) therefore applies and takes precedence over 2(d)(iii).

I would not be averse to a note in 2(d)(iii) that points this out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100280</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2014-02-11 14:12:32 +0000</bug_when>
    <thetext>We probably need to apply this rule to both a function call and a dynamic function call, or does &quot;function call&quot; already entails dynamic function calls? Not sure about production rules here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100281</commentid>
    <comment_count>4</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2014-02-11 14:48:17 +0000</bug_when>
    <thetext>We discussed this in Prague.

The functions with arguments of usage = transmission that fall under the rule in 2(d)(iii) are:  exactly-one(), head(), zero-or-one().  (Others are transmissional but have cardinality gt 1.)  There was resistance to listing these in normative prose, but a note saying something like &quot;at the time this spec was first published, the functions in question were: ...&quot; would be OK.

It might also be helpful to be more explicit about invariants known to be true when 2(d)(iii) applies:  

- We know we&apos;re talking about a built-in or extension function, and not a stylesheet function (stylesheet function arguments have type determined usage and don&apos;t reach this point).

- We know that the operand usage is transmission.

- We know it&apos;s not a dynamic function call but a static one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100599</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-14 17:35:40 +0000</bug_when>
    <thetext>I have added a note explaining that these are the only three functions to which this rule applies (at present), and explaining why.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>