<?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>6807</bug_id>
          
          <creation_ts>2009-04-13 19:39:47 +0000</creation_ts>
          <short_desc>[FO] ambiguity in fn:namespace-uri-for-prefix</short_desc>
          <delta_ts>2009-07-20 20:15:50 +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 1.0</component>
          <version>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="Andrew Eisenberg">andrew.eisenberg</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>jim.melton</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>24702</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2009-04-13 19:39:47 +0000</bug_when>
    <thetext>Bug 5703, reported against XQTS and closed last year, suggested that the correct response for

namespace-uri-for-prefix(&apos;&apos;, $in-xml)

was a zero-length string, where there is no default namespace in the in-scope namespaces of $in-xml.


In 11.2.5 fn:namespace-uri-for-prefix we say,

&quot;If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.&quot;


Where there is no default namespace, one could imagine returning either an empty sequence or a zero-length string as the result.

Michael Kay has suggested that specifying the result as the zero-length string would be consistent with namespace-uri and namespace-uri-from-QName.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24712</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-04-14 08:14:13 +0000</bug_when>
    <thetext>I agree this should be clarified. I suggest:

* If $element has an in-scope namespace whose namespace prefix is equal to $prefix, the function returns the namespace URI of that namespace. 

* If $prefix is the zero-length string or the empty sequence, the function returns the namespace URI of the default namespace for $element if there is one, or the zero-length string otherwise 

* In all other cases, the function returns the empty sequence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24947</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-04-28 12:35:06 +0000</bug_when>
    <thetext>Investigation shows that different implementors have indeed interpreted this differently: some return &quot;&quot;, some ().

In favour of &quot;&quot;:

* this means that a return result of () always means the prefix is not available for use

* the prefix &quot;&quot; in this situation means &quot;no namespace&quot;, and in other functions such as namespace-uri(), or namespace-uri-from-QName(), &quot;no namespace&quot; is denoted by &quot;&quot;.

* This intepretation means that a redundant &quot;xmlns=&apos;&apos;&quot; declaration has no effect, which is desirable, since it has no meaning.

* this is what the spec currently says:

&quot;If $element has an in-scope namespace whose namespace prefix is equal to $prefix...&quot; - not applicable, it doesn&apos;t.

&quot;If $prefix is the zero-length string ..., it returns the namespace URI of the default (unnamed) namespace. - the condition is satisfied, so the only question is &quot;what is the namespace URI of the default (unnamed) namespace?&quot; In other methods, it is always &quot;&quot;.

&quot;Otherwise, it returns the empty sequence.&quot; - not applicable, we don&apos;t get this far.

Michael Kay

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25821</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-06-30 09:17:04 +0000</bug_when>
    <thetext>A decision on this was recorded in the minutes on 28 April:

http://lists.w3.org/Archives/Member/w3c-xsl-query/2009Apr/0069.html (member-only link)

The decision was to return a zero-length string.

An erratum will be drafted against the &quot;second edition&quot; spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25851</commentid>
    <comment_count>4</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2009-07-03 19:43:23 +0000</bug_when>
    <thetext>I am marking this RESOLVED FIXED because WG has made the decision. (The editor will implement the solution on his own timetable.) If you&apos;re satisfied with this resolution, please mark the bug CLOSED. </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>