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 14185 - [F+O30] fn:collection/fn:doc FODC0002
Summary: [F+O30] fn:collection/fn:doc FODC0002
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 15:40 UTC by Tim Mills
Modified: 2011-10-24 15:59 UTC (History)
2 users (show)

See Also:


Attachments

Description Tim Mills 2011-09-16 15:40:11 UTC
There is (inconsistent overloading of error codes in fn:doc and fn:collection.

fn:doc

FODC0002 - dereferencing/parsing fails
        OR available documents provides no mapping for the absolutized URI.
FODC0005 - invalid URI

Here FODC0002 is overloaded with two possible meanings.

fn:collection
FODC0002 - dereferencing/parsing failso
FODC0004 - invalid URI
        OR available collections provides no mapping for the absolutized URI.

Here FODC004 is overloaded.  It seams inconsistent that FODC0004 is overloaded here, rather than FODC0002.  The brief description of FODC0002 as "Error retrieving resource." seems to indicate that FODC0002 should be the code when available collections provides no mapping fo the absolutized URI.

Vaguely related bug reports are Bug 3726 and Bug 7072.  The proposed text in 7072:

" The collection URI is dereferenced to yield a resource that provides a set of document URIs. If this dereferencing operation fails, an error is raised [err:FODC0002]"

seems to suggest that FODC0002 should indeed be used when no mapping is available.
Comment 1 Tim Mills 2011-09-16 15:50:02 UTC
Note that in XQTS, fn-collection-2, FODC0002 was expected

  <test-case is-XPath2="true" name="fn-collection-2" FilePath="Functions/NodeSeqFunc/SeqCollectionFunc/" scenario="runtime-error" Creator="Carmelo Montanez">
      <description>Evaluation of fn:collection, for a non existent resource.</description>
      <spec-citation spec="FuncOps" section-number="15.5.6" section-title="fn:collection" section-pointer="func-collection"/>
      <query name="fn-collection-2" date="2005-12-02"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <expected-error>FODC0002</expected-error>
   </test-case>

whereas in the new test suite, this has been changed to FODC0004.

   <test-case name="fn-collection-2">
      <description> Evaluation of ana fn:collection, which tries to retrieve a non-existent resource. </description>
      <created by="Carmelo Montanez" on="2005-12-02"/>
      <test>fn:collection("thisfileshouldnotexists")</test>
      <result>
         <error code="FODC0004"/>
      </result>
   </test-case>
Comment 2 Tim Mills 2011-10-18 08:33:37 UTC
A decision was mae in the XML Query/XSL WG Joint Teleconference #486 2011-10-04 regarding Bug 14185.

DECISION: Re Bug 14185, [F+O30] fn:collection/fn:doc FODC0002:
Change error conditions for fn:collection. Move "no mapping" condition
from FODC0004 to FODC0002.
Comment 3 O'Neil Delpratt 2011-10-18 10:17:36 UTC
Fixed in the CVS. Changes made to K2-SeqCollectionFunc-1, K2-SeqCollectionFunc-2, fn-collection-2, fn-collection-3, collection-900, collection-901, collection-902
Comment 4 O'Neil Delpratt 2011-10-18 10:33:08 UTC
(In reply to comment #3)
> Fixed in the CVS. Changes made to K2-SeqCollectionFunc-1,
> K2-SeqCollectionFunc-2, fn-collection-2, fn-collection-3, collection-900,
> collection-901, collection-902

Correction Changes only applied to collection-900 and fn-collection-2
Comment 5 Tim Mills 2011-10-24 15:59:58 UTC
Confirmed fixed in the text suite, thanks.

Leaving open until the specification is also updated.