<?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>4487</bug_id>
          
          <creation_ts>2007-04-23 21:28:08 +0000</creation_ts>
          <short_desc>[DM] Missing constraint for attribute names</short_desc>
          <delta_ts>2008-08-13 18:50:43 +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>Data Model 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="Michael Kay">mike</reporter>
          <assigned_to name="Anders Berglund">alb.w3c</assigned_to>
          <cc>andrew.eisenberg</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>14855</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-04-23 21:28:08 +0000</bug_when>
    <thetext>Nowhere does XDM state the following constraint, which is necessary to ensure that an XDM document can be serialized as namespace-well-formed XML.

Add the following either to the numbered list in 6.3.1 (Attribute Nodes/Overview), or to the bulleted list in 3.3.3 (QNames and NOTATIONs), or both, at editor&apos;s discretion: 

* In the node-name of an attribute node, if a namespace URI is present then a prefix must also be present.

See also bug #4443. This bug is raised in response to action A-327-04.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14900</commentid>
    <comment_count>1</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2007-04-27 10:02:28 +0000</bug_when>
    <thetext>I don&apos;t understand why this situation is any different to having an attribute with a namespace prefix that cannot be used since the prefix is already bound on the same element to a different namespace URI. In both cases the XDM shouldn&apos;t care, because the prefix is irrelevant to the actual name of the attribute (the namespace URI/local name pair).

In my opinion this situation is a serialisation issue, and should be dealt with during serialisation. I think the obvious solution is to make up a namespace prefix for the attribute in both cases - but an alternative solution is to raise an error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14901</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-04-27 10:22:54 +0000</bug_when>
    <thetext>Namespace fixup is not the responsibility of the serializer: the XDM model contains the tree structure *after* fixup has been applied. This enables anyone accessing an XDM tree to be confident that it will satisfy basic XML rules such as names being valid, and no element having two attributes with the same name. The rule that an attribute in a namespace always has a prefix falls into the same category.

&gt;In both cases the XDM
shouldn&apos;t care, because the prefix is irrelevant to the actual name of the
attribute (the namespace URI/local name pair).

The name of the attribute is not a namespace URI/local name pair: it is a triple that also includes a prefix: see section 3.3.3 (&quot;In this Data Model, therefore, the value space for qualified names contains a local-name, an optional namespace URI, and an optional prefix.&quot;)

The prefix is ignored when comparing two names, but it is visible to applications via functions such as name(). It&apos;s important from a usability perspective that name() applied to a node should return the same string that you see when serializing the node, since it is often used in messages and similar output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14902</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-04-27 11:39:07 +0000</bug_when>
    <thetext>&gt;I don&apos;t understand why this situation is any different to having an attribute with a namespace prefix that cannot be used

It isn&apos;t any different, that&apos;s the whole point. In both cases, namespace fixup should ensure that the data model is correct and consistent. The only difference is that we already have constraints saying that if the attribute has a prefix then the prefix must be in-scope on the containing element; we don&apos;t currently have a constraint saying that if it has a URI then it must have a prefix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15041</commentid>
    <comment_count>4</comment_count>
    <who name="Norman Walsh">Norman.Walsh</who>
    <bug_when>2007-05-08 14:14:33 +0000</bug_when>
    <thetext>I agree with Mike.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17802</commentid>
    <comment_count>5</comment_count>
    <who name="Anders Berglund">alb.w3c</who>
    <bug_when>2007-11-19 21:33:13 +0000</bug_when>
    <thetext>The WGs decided to accept the proposed solution in the description as the fix
for this bug at the Joint telcon 329 of 2007-05-08.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>