<?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>3960</bug_id>
          
          <creation_ts>2006-11-08 16:59:35 +0000</creation_ts>
          <short_desc>fn-in-scope-prefixes-3</short_desc>
          <delta_ts>2006-11-09 10:24:39 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.1</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</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="Tim Mills">tim</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</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>12864</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-11-08 16:59:35 +0000</bug_when>
    <thetext>If I understand this correctly,

fn:in-scope-prefixes(&lt;anElement&gt;some content&lt;/anElement&gt;)

should return a sequence of two prefixes, namely the &quot;&quot; (empty xs:string) and &quot;xml&quot; (xs:NCName).

From:

http://www.w3.org/TR/xslt-xquery-serialization/#serdm

following the serialization rule:

&quot;For each subsequence of adjacent strings in S2, copy a single string to the new sequence equal to the values of the strings in the subsequence concatenated in order, each separated by a single space. Copy all other items to the new sequence. The new sequence is S3.&quot;

Shouldn&apos;t the expected answer here be &quot; xml&quot; or &quot;xml &quot;, and not &quot;xml&quot; as specified?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12874</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-11-08 21:54:23 +0000</bug_when>
    <thetext>&gt;If I understand this correctly,
&gt;fn:in-scope-prefixes(&lt;anElement&gt;some content&lt;/anElement&gt;)
&gt;should return a sequence of two prefixes

No, it should only return one. The prefix &quot;&quot; is not bound to any namespace, so there is no namespace node/binding for it. This would be true even if the element were written &lt;anElement xmlns=&quot;&quot;&gt;some content&lt;/anElement&gt;: this undeclares a namespace (deletes a namespace binding), it does not create a new binding.

Michael Kay </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12879</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-11-09 07:42:37 +0000</bug_when>
    <thetext>Thanks - I understand now.  

I was under the impression that the empty namespace was bound here to the default element namespace.  Following the rule in XQuery 3.7.4 (In-scope Namespaces of a Constructed Element):

&quot;For each namespace used in the name of the constructed element or in the names of its attributes, a namespace binding must exist.&quot;

Here I&apos;d thought that &lt;anElement&gt; has the local name &quot;anElement&quot;, prefix &quot;&quot; and the default element namespace.  Of course, in this example the default namespace is &quot;no namespace&quot;.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12880</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-11-09 10:07:58 +0000</bug_when>
    <thetext>For some reason that I&apos;ve never understood, but that has caused untold confusion ever since, the authors of the Namespaces Rec went out of their way to insist that what we sometimes call the &quot;null namespace&quot; and what you call the &quot;empty namespace&quot; or &quot;no namespace&quot; is not in fact a namespace. So when you read a phrase like &quot;for each namespace...&quot; it doesn&apos;t include the null|empty|no|absent namespace, because that isn&apos;t a namespace. 

No prefix is ever bound to this non-namespace; no namespace binding or namespace node ever references it. Declarations like xmlns=&quot;&quot; and in XML 1.1, xmlns:p=&quot;&quot; terminate a binding, they do not create a new one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12881</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-11-09 10:24:39 +0000</bug_when>
    <thetext>Thanks for the clarification.

BTW, my use of &quot;no namespace&quot; was in taken from XQuery C.1 Static Context Components.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>