<?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>29404</bug_id>
          
          <creation_ts>2016-01-29 23:34:03 +0000</creation_ts>
          <short_desc>[QT3]  anyURI in fn:collection</short_desc>
          <delta_ts>2016-07-21 21:38:31 +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>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="Benito van der Zander">benito</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>andrew_coleman</cc>
    
    <cc>oneil</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>124746</commentid>
    <comment_count>0</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-01-29 23:34:03 +0000</bug_when>
    <thetext>The FO says about fn:collection  &quot;A dynamic error is raised [err:FODC0004] if $arg is not a valid xs:anyURI.&quot; 

But in XSD1.1 there are no restriction on valid anyURIs (compare 27742)

There are some tests (fn-collection-3, K2-SeqCollectionFunc-2, K2-SeqCollectionFunc-1, collection-902, cbcl-collection-001) testing for FODC0004 on invalid anyURIs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124750</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-01-30 02:21:46 +0000</bug_when>
    <thetext>Possibly the error description should be updated to reflect that it should be valid according to RFC 3986, or the tests should specify an XSD 1.0 dependency. Note that for fn:doc the error description is slightly different:

A dynamic error may be raised [err:FODC0005] if $uri is not a valid URI reference.

But this may be vague on purpose. However, also in the case of fn:doc there is no mention of the URI to have to be valid according to the RFC, in fact, the term URI reference is not linked or defined clearly in this context.

Looking further, the function fn:collation-key, which takes a URI as well, has no error conditions at all for an invalid URI, I raised that separately: bug 29406.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124760</commentid>
    <comment_count>2</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-01-30 09:59:55 +0000</bug_when>
    <thetext>The tests FODC0004 and FODC0005-1 in misc-CombinedErrorCodes might deserve a further examination, too</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124905</commentid>
    <comment_count>3</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2016-02-08 14:42:46 +0000</bug_when>
    <thetext>The WG agreed at the telcon on the 02/02/16 to add the dependency on XSD 1.0 for the tests specified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124908</commentid>
    <comment_count>4</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2016-02-08 15:50:58 +0000</bug_when>
    <thetext>I have reviewed this bug again and I think that this bug should be against the FO spec. The text for fn:collection needs changing to be consistant with fn:doc. i.e.: &quot;A dynamic error may be raised [err:FODC0005] if $uri is not a valid URI.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125068</commentid>
    <comment_count>5</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-02-16 04:14:52 +0000</bug_when>
    <thetext>The same issue exists for uri-collection ofc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125383</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-08 15:59:16 +0000</bug_when>
    <thetext>I think the rule for all the &quot;resource access&quot; functions should be that when the URI is invalid, the processor is allowed to raise an error but is not required to do so.

The relevant functions are:

doc
doc-available
collection
uri-collection
unparsed-text
unparsed-text-lines
unparsed-text-available
json-doc

Current handling of invalid URIs is as follows:

doc: MAY raise FODC0005
doc-available: MUST raise FODC0005
collection: MUST raise FODC0004
uri-collection: MUST raise FODC0004
unparsed-text: no specific error; treated the same as &quot;no resource found&quot;
unparsed-text-lines - same as unparsed-text
unparsed-text-available - returns false
json-doc - same as unparsed-text

I propose to change doc-available to return false, aligning it with unparsed-text-available.

I propose to change collection and uri-collection from MUST to MAY, for alignment with doc().

I propose no change for the unparsed-text family of functions; the cost of a change to make them more consistent with doc and collection is greater than the benefit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125439</commentid>
    <comment_count>7</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-03-11 13:10:29 +0000</bug_when>
    <thetext>At the meeting on 2016-03-08, the WG agreed to adopt the changes proposed in comment 6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125578</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-21 22:58:23 +0000</bug_when>
    <thetext>The changes have been applied, and relevant tests have been updated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126434</commentid>
    <comment_count>9</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-05-13 19:47:21 +0000</bug_when>
    <thetext>In comment 3 I said

&gt;The tests FODC0004 and FODC0005-1 in misc-CombinedErrorCodes might deserve a further examination, too

Since the collection tests were changed, those two should be changed, too</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126562</commentid>
    <comment_count>10</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2016-05-24 16:06:17 +0000</bug_when>
    <thetext>(In reply to Benito van der Zander from comment #9)
&gt; In comment 3 I said
&gt; 
&gt; &gt;The tests FODC0004 and FODC0005-1 in misc-CombinedErrorCodes might deserve a further examination, too
&gt; 
&gt; Since the collection tests were changed, those two should be changed, too

Yes I agree that with the changes mentioned in comment #6 that we should add the alternative error code FODC0002 in the test cases mentioned. I have made the change and committed them to cvs.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>