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 17707 - fn-unparsed-text-023
Summary: fn-unparsed-text-023
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Tim Mills
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-06 12:05 UTC by Michael Kay
Modified: 2013-03-20 10:55 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2012-07-06 12:05:42 UTC
Test fn-unparsed-text-023 has an environment that explicitly sets the static base URI to "undefined"; it then uses a relative URI in the call to unparsed-text(), and expects an error code of XPST0001. A number of other tests in the unparsed-text() family are similar.


Several problems.

 (a) the documentation/schema says that the magic value is "##undefined" rather than "#UNDEFINED". I have changed the schema to match the instances.

 (b) there's nothing that requires a processor to be able to set the static base URI to "undefined". In Saxon, for example, the base URI defaults to the current working directory. The test therefore has a dependency which needs to be documented.

 (c) even if the static base URI is undefined, I'm not sure a static error is appropriate. The spec of XPST0001 says "If analysis of an expression relies on some component of the static context that has not been assigned a value, a static error is raised [err:XPST0001].". But the analysis of this expression doesn't depend on knowing the static base URI; it is only the execution that relies on it (static base URI is used only if the supplied URI is relative, which is not known until execution time). (The debate on static base URI versus dynamic Base URI is relevant here).
Comment 1 O'Neil Delpratt 2012-07-06 13:32:07 UTC
Hi Tim, I am assigning this bug entry to you.
Comment 2 Tim Mills 2012-07-06 13:40:05 UTC
>  (b) there's nothing that requires a processor to be able to set the static
> base URI to "undefined". In Saxon, for example, the base URI defaults to the
> current working directory. The test therefore has a dependency which needs to
> be documented.

How would you like this to be documented?  i.e. do you want a <dependency> element e.g.

<dependency type="feature" value="canHaveUndefinedBaseURI" />
Comment 3 Tim Mills 2012-07-06 13:58:31 UTC
This test was written following the examples for fn:doc.  See for example:

   <test-case name="K2-SeqDocFunc-4">
      <description> Invoke fn:doc with a relative, Unix-like URI. Since it's relative, and the base-uri may be undefined, XPST0001 is allowed. </description>
      <created by="Frans Englich" on="2007-11-26"/>
      <test>doc("/example.com/example.org/does/not/exist/doesNotExist/works-mod.xml")</test>
      <result>
         <any-of>
            <error code="FODC0002"/>
            <error code="XPST0001"/>
         </any-of>
      </result>
   </test-case>

While I see your point, I'm not inclined to change the expected result unless all tests expecting XPST0001 are reviewed.  And if it were to be changed, to what code would you suggest?
Comment 4 Tim Mills 2013-01-30 22:16:02 UTC
Any further comments or would you be happy to close?
Comment 5 O'Neil Delpratt 2013-03-20 10:55:00 UTC
I think we can closed this bug now.