<?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>3485</bug_id>
          
          <creation_ts>2006-07-18 21:03:15 +0000</creation_ts>
          <short_desc>[XQuery] relative URILiteral</short_desc>
          <delta_ts>2007-02-25 23:50:46 +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>XQuery 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="David Carlisle">davidc</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          
          
          <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>10580</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2006-07-18 21:03:15 +0000</bug_when>
    <thetext>The XQuery spec seems to be inconsistemt on whether URILiteral terms may be relative.

The clause is defined in section 2.4.5 which says

    However, an implementation MAY raise a static error [err:XQST0046]
    ... or if it is a string that represents a &quot;relative reference&quot;
    as defined in [RFC3986].

So it would appear that a relative URI is an error that may be reported as
XQST0046, however at least two places where URILiteral terms are used give explict non-error behaviour for relative URI.


3.8.3
     If an orderspec specifies a collation by a relative URI,
     that relative URI is resolved to an absolute URI using
     the base URI in the static context.


4.4
     If a default collation declaration specifies a collation
     by a relative URI, that relative URI is resolved to an
     absolute URI using the base URI in the static context. 

Perhaps 2.4.5 should be ammended to say that XQST0046
may be raised (just) if the URI Literal is not an absolute URI after resolving (if necessary) against the base URI in the static context.


Note this affects several test suite tests, see bug #3447

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10645</commentid>
    <comment_count>1</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2006-07-21 22:16:50 +0000</bug_when>
    <thetext>As I see it, URILiterals are used in two different ways: referring to namespaces and as resource(file) references. Applying resolution of relative URILiterals is invasive(at this stage) because it affects much. It perhaps neither makes sense for namespaces. One could also question if resolving against the static base URI makes sense for all URILiteral scenarios.

Replying comment #2 in #3447:

Relative URIs in location hints in schema imports and and module imports can be valid, because both their sections reads:

&quot;The URILiterals that follow the at keyword are optional location hints, and can be interpreted or disregarded in an implementation-dependent way.&quot;

I think this should be changed to that they are resolved against the static base URI, because: 1) it&apos;s what users expects(it&apos;s common behavior; xml:base/XInclude to mention XML examples), 2) it is what typically is implemented, is my guess; and 3) it affects interoperability. Location hints in the mentioned declaration imports aren&apos;t interoperable for even the most basic schemes(such as http:// and file://, which are rather common). However, there&apos;s perhaps a conscious reason to why not even relative URI-resolving have been specified.

Proposed fix:

In 4.10 Schema Import and 4.11 Module Import replace:

&quot;The URILiterals that follow the at keyword are optional location hints, and can be interpreted or disregarded in an implementation-dependent way.&quot;

with:

&quot;The URILiterals that follow the at keyword are optional location hints which are resolved against the base URI if being relative URIs, but beyond that are interpreted or disregarded in an implementation-dependent way.&quot;

I think it would solve one of David&apos;s interests in resolving URILiterals.

That &quot;2.4.5 URI Literals&quot; clashes with sections that more specifically describes the URILiteral, can perhaps be solved with this proposed change:

In &quot;2.4.5 URI Literals&quot;, replace:

&apos;However, an implementation MAY raise a static error [err:XQST0046] if the value of a URILiteral is of nonzero length and is not in the lexical space of xs:anyURI, or if it is a string that represents a &quot;relative reference&quot; as defined in [RFC3986].&apos;

with:

&apos;However, an implementation MAY raise a static error [err:XQST0046] if the value of a URILiteral is of nonzero length and is not in the lexical space of xs:anyURI. An implementation MAY also raise a static error [err:XQST0046] if it is a string that represents a &quot;relative reference&quot; as defined in [RFC3986], unless any section that specifically applies to the URILiteral in question specifies how a &quot;relative reference&quot; is handled.&apos;

That is, it allows other sections to &quot;override&quot; the more general one in &quot;2.4.5 URI Literals&quot; which currently is intended(I think). It&apos;s not very clean(e.g, it&apos;s an exception), but perhaps it is /better/ and the best approach available at this stage.


Frans</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11125</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-08-15 16:05:23 +0000</bug_when>
    <thetext>Note also a typo in section 2.4.5:

$#xA;

should read

&amp;#xA;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11185</commentid>
    <comment_count>3</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2006-08-16 23:11:36 +0000</bug_when>
    <thetext>I have corrected the typo identified in Comment #2. Thanks, Mike! Since this bug report has a larger scope, I am leaving it open.
--Don Chamberlin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11633</commentid>
    <comment_count>4</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2006-09-12 23:00:06 +0000</bug_when>
    <thetext>David,
In a meeting on Aug. 25, 2006, the Query Working Group decided that the definition of a URILiteral should be changed to allow a relative URI. XQuery section 2.4.5 and error message XQST0046 have been edited accordingly. The working group believes that this change resolves the issue raised by this bug report. If you agree, please change the status of this report to &quot;Closed&quot;.
Regards,
Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11634</commentid>
    <comment_count>5</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2006-09-12 23:22:18 +0000</bug_when>
    <thetext>I&apos;m happy with the resolution that syntactically a relative uri literal
should not be an error, but your message doesn&apos;t say what the non error
meaning should be,  this isn&apos;t clear in all cases.

As noted in comment 0, the behaviour of relative collation URI are already specified (resolve against the base uri in the static context)

This should also probably be the behaviour in other cases (eg module and schema import) However in namespace declarations relative URI should probably still be an error (although you may want to make it just optional that the error is reported which is probably the original reason for the current text in 2.4.5) w3c policy being that relative namespace uri are evil and specs should not assign meaning to them)

specifying a relative base uri (using the prolog declaration or xml:base) is another tricky case that has its own entry, bug #3486

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11649</commentid>
    <comment_count>6</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2006-09-13 12:51:17 +0000</bug_when>
    <thetext>I see you&apos;ve responded to bug #3486, so I think that means that the only case
that would be left undefined would be namespace uri

Could the specification clarify whether the following is in error, and if not in error, what the namespaces of the elements x and y are?

to be specific:


declare base-uri  &quot;data:,x&quot;;
declare default element namespace &quot;abc/123&quot;;

&lt;x&gt;
 &lt;y xmlns=&quot;xyz&quot;/&gt;
&lt;/x&gt;

Currently saxon gives no error and produces

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;x xmlns=&quot;abc/123&quot;&gt;
   &lt;y xmlns=&quot;xyz&quot;/&gt;
&lt;/x&gt;


I wouldn&apos;t object to that being the specified behaviour although
acording to a w3c directive that &quot;revised&quot; the interpretation of the namespaces spec, such an xml document has undefined behaviour and shouldn&apos;t be assigned
definite semantics, so XQuery might want to make relative uri namespaces explictly an error, or undefined, and may want to state explictly that they are _not_ resolved against the base uri in the static context (unlike all other uses of uriliteral)


http://lists.w3.org/Archives/Public/xml-uri/2000Sep/0083.html

and namespaces 1.1 which rather commits xpath2 (at least) to not doing much with relative uri namespace literals.

http://www.w3.org/TR/REC-xml-names/#iri-use

  This deprecation of relative URI references was decided on by a W3C XML
  Plenary Ballot Relative URI deprecation]. It also declares that &quot;later
  specifications such as DOM, XPath, etc. will define no interpretation for
  them&quot;.

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14163</commentid>
    <comment_count>7</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2007-02-25 23:50:46 +0000</bug_when>
    <thetext>Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>