<?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>2260</bug_id>
          
          <creation_ts>2005-09-16 12:55:50 +0000</creation_ts>
          <short_desc>[xqueryx]  namespace attributes</short_desc>
          <delta_ts>2005-09-27 09:39:28 +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>XQueryX 1.0</component>
          <version>Last Call drafts</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="Jim Melton">jim.melton</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>6322</commentid>
    <comment_count>0</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-09-16 12:55:50 +0000</bug_when>
    <thetext>Currently a namespace declaration on a direct element constructor such as
&lt;a xmlns:x=&quot;a&quot;&gt;&lt;/a&gt;
is encoded using

               &lt;xqx:attributeConstructor&gt;
                  &lt;xqx:attributeName xqx:prefix=&quot;xmlns&quot;&gt;x&lt;/xqx:attributeName&gt;
                  &lt;xqx:attributeValue&gt;a&lt;/xqx:attributeValue&gt;
               &lt;/xqx:attributeConstructor&gt;

There is a certain amount of history as to why namespace declarations use
xml attribute syntax, but that history doesn&apos;t apply here. These are not
attributes to the XPath/Xquery data model, and they have a radically different
effect on the static context.  xmlns: isn&apos;t a prefix in the currently known
namespaces, so it&apos;s a misuse of the xqx:QName type to represent xmlns:x as
a Qname with prefix xmlns.

XqueryX should have a separate xqx:namespaceName
xqx:namespaceValue construct to generate the namespace binding.

the schema declaration for xqx:attributeName should have a pattern facet
restricting the name not to be xmlns or begin with xmlns:

David</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6338</commentid>
    <comment_count>1</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-09-19 09:47:58 +0000</bug_when>
    <thetext> Actually I note that the example in section 3.4 encodes the namespace
declaration as
  &lt;xqx:attributeName&gt;xmlns:ma&lt;/xqx:attributeName&gt;
rather than
    &lt;xqx:attributeName xqx;prefix=&quot;xmlns&quot;&gt;ma&lt;/xqx:attributeName&gt;
but that&apos;s even worse: it&apos;s not valid against the schema which which has base type
xs:NCName so can&apos;t have a colon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6360</commentid>
    <comment_count>2</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2005-09-20 11:52:06 +0000</bug_when>
    <thetext>Thank you very much for this observation and discussion.  I have not yet spent
the time to think about this fully, but I&apos;m inclined to agree with your point. 
We will investigate this more fully and come up with an appropriate way to
reprseent namespace declarations. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6460</commentid>
    <comment_count>3</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2005-09-26 21:56:02 +0000</bug_when>
    <thetext>We agree with your comment and have modified the XQueryX schema to permit
namespace declarations in element constructors through the use of a new element
xqx:namespaceDeclaration having subelements xqx:prefix and xqx:uri.  This new
element will be an alternative within xqx:attributeList.  We will also prohibit
xqx:attributeConstructor&apos;s xqx:attributeName child from taking on the value
&quot;xmlns&quot; or values starting with &quot;xmlns:&quot;. 

We have enhanced the XQueryX stylesheet to reflect these changes. 

Please let us know if you agree with this resolution of your issue, by adding a
comment to the issue record and changing the Status of the issue to Closed. Or,
if you do not agree with this resolution, please add a comment explaining why.
If you wish to appeal the WG&apos;s decision to the Director, then also change the
Status of the record to Reopened. If you wish to record your dissent, but do not
wish to appeal the decision to the Director, then change the Status of the
record to Closed. If we do not hear from you in the next two weeks, we will
assume you agree with the WG decision.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6467</commentid>
    <comment_count>4</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-09-26 22:56:20 +0000</bug_when>
    <thetext>   We will also prohibit
   xqx:attributeConstructor&apos;s xqx:attributeName child from taking on the value
   &quot;xmlns&quot; or values starting with &quot;xmlns:&quot;.


This is what I suggested but actually you only need to restrict xmlns.
xmlns: isn&apos;t allowed anyway as the base type of attributeNmae is xs:NCName so
doesn&apos;t allow :.

However I leave the details to the editor and am closing this report anyway.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6479</commentid>
    <comment_count>5</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2005-09-27 09:39:28 +0000</bug_when>
    <thetext>One further comment, even though this is closed

It may be best to make the restriction in the stylesheet generating an error
if the attribute name is xmlns _and no prefix_.

XSD schema can&apos;t restrict the content based on the non appearance of an
attribute. You probably do need to allow an attribute named fobar:xmlns
(ie xqx:prefix=&quot;foobar&quot; and content equal to xmlns, as these are allowed even
though bad form, xmlns 1.1 says:


http://www.w3.org/TR/xml-names11/#xmlReserved
Though they are not themselves reserved, it is inadvisable to use prefixed names 
whose LocalPart begins with the letters x, m, l, in any case combination, as
these names would be reserved if used without a prefix.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>