<?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>800</bug_id>
          
          <creation_ts>2004-06-16 06:39:13 +0000</creation_ts>
          <short_desc>xmlns attribute for XML namespace not allowed</short_desc>
          <delta_ts>2008-12-01 03:05:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Validator</product>
          <component>check</component>
          <version>0.7.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.livinglogic.de/Python/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.8.0</target_milestone>
          
          <blocked>4475</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Walter D">walter</reporter>
          <assigned_to name="Olivier Thereaux">ot</assigned_to>
          <cc>aaz</cc>
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2019</commentid>
    <comment_count>0</comment_count>
    <who name="Walter D">walter</who>
    <bug_when>2004-06-16 06:39:16 +0000</bug_when>
    <thetext>For the URL http://www.livinglogic.de/Python/ the validator complains about a
namespace declaration for the XML namespace. The XHTML file starts with: 
&lt;?xml version=&apos;1.0&apos; encoding=&apos;utf-8&apos;?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot; lang=&quot;en&quot; xml:lang=&quot;en&quot;&gt;

IMHO this namespace declaration should be allowed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2029</commentid>
    <comment_count>1</comment_count>
    <who name="Bj">bjoern</who>
    <bug_when>2004-06-17 18:40:36 +0000</bug_when>
    <thetext>If you check http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd you will 
find that an &quot;xmlns:xml&quot; attribute is not allowed for the &lt;html&gt; element. If 
you think this should be changed, you should read the Status section of the 
XHTML 1.0 Recommendation http://www.w3.org/TR/xhtml1/ and post a comment to the 
www-html-editor mailing list. If you can convince the HTML Working Group to 
change the document type definition we will upgrade the Validator to use the 
new document type definition instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7548</commentid>
    <comment_count>2</comment_count>
    <who name="Jon Wickstr">jontesreklampost</who>
    <bug_when>2005-12-27 00:25:46 +0000</bug_when>
    <thetext>Comment #1 cleverly avoids stating the original bugreport is invalid. :-)

I get the same error when I have a &apos;xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&apos; 
attribute on an nonroot-element in my document. The DTD only alows (and 
requires) it on the html element.

But isn&apos;t the xmlns attribute part of the XML-specification. It is kind of 
part of the layer under XHTML?

The XHTML recommendation states (in http://www.w3.org/TR/xhtml1/#well-formed) 
states that other namespaces MAY be used. But the document is then 
nolonger &quot;strictly conforming&quot;. It does not state what the document then is.

But in my case I am not using another namespace. And according to 
http://www.w3.org/TR/REC-xml-names/ the xmlns-attribute is valid on any 
element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7550</commentid>
    <comment_count>3</comment_count>
    <who name="Bj">bjoern</who>
    <bug_when>2005-12-27 18:55:30 +0000</bug_when>
    <thetext>http://www.w3.org/TR/REC-xml-names does not state this, a document is valid or 
namespace-valid iff it meets the constraints of the markup declarations, if you 
do not have a ATTLIST declaration for the xmlns attribute or the xmlns:xml 
attribute on the relevant elements, then the document is not valid; the XHTML 
1.0 DTDs don&apos;t do this, so for &quot;XML validity&quot; of &quot;XHTML 1.0 documents&quot; this is 
not allowed. You might disagree with these design decisions of the HTML Working 
Group, in this case you should raise your concern on www-html-editor@w3.org, 
the Validator just checks whether documents meet the constraints, we don&apos;t make 
them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13358</commentid>
    <comment_count>4</comment_count>
    <who name="Jeff Jackson">jacksonj</who>
    <bug_when>2007-01-05 22:23:02 +0000</bug_when>
    <thetext>The XHTML validator currently complains about the html tag in a document beginning:

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:xhtml=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

According to http://www.w3.org/TR/2006/REC-xml-names-20060816 Section 2.1, &quot;An attribute-based declaration syntax is provided to bind prefixes to namespace names and to bind a default namespace that applies to unprefixed element names; these declarations are scoped by the elements on which they appear so that different bindings may apply in different parts of a document. Processors conforming to this specification MUST recognize and act on these declarations and prefixes.&quot;

This sounds to me (as claimed before by someone else in Comment #2) like the XML Namespaces rec is saying that xmnls and xmlns-prefixed attributes do not need to be included in any ATTLIST of the DTD in order to be valid; they must be recognized. An attribute-based syntax is used, but these are not standard attributes.

Think of it this way: if a DTD had an ATTLIST containing the single attribute xmlns:hmm, would that mean that I could include a namespace declaration such as xmnls:hmm=&quot;http://www.example.org&quot; but I couldn&apos;t use a namespace declaration such as xmlns:duh=&quot;http://www.example.com&quot;?  Of course not: surely in any document conforming with XML Namespaces I should be able to choose any namespace prefix I want (as long as it isn&apos;t reserved).  So xmlns:duh must also be a valid attribute.

This means that xmlns-prefixed attribute specifications cannot be treated the same way for validation purposes as are normal attributes by looking for them in a DTD.  And in light of the quote above, I think that it&apos;s clear that xmlns and xmlns-prefixed attributes must be considered valid on every tag in every document conforming with XML Namespaces.

So I believe that it is wrong for the XHTML validator to complain about the html tag above as well as about the original markup in the original bug report and that in Comment #2.  I don&apos;t think that this is a problem with the XHTML/XML/XML Namespaces recommendations, but with how the validator is implementing them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14935</commentid>
    <comment_count>5</comment_count>
      <attachid>466</attachid>
    <who name="Shane McCarron">shane</who>
    <bug_when>2007-04-28 03:42:24 +0000</bug_when>
    <thetext>Created attachment 466
Patch to implement ignoring xmlns: attribute declaration errors

Actually, since XHTML family document types adhere to the XML and XML Namespace recommendations, Comment #4 is correct - any xmlns:whatever attribute should be permitted on any element.  Unfortunately, this is somewhat challenging to implement in validation engine that we have available.  I have a patch for &quot;check&quot; that permits it to ignore errors of this type against the 0.8.0 beta.  I will attach it here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14936</commentid>
    <comment_count>6</comment_count>
      <attachid>467</attachid>
    <who name="Shane McCarron">shane</who>
    <bug_when>2007-04-28 04:01:40 +0000</bug_when>
    <thetext>Created attachment 467
Updated against version 1.507</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14945</commentid>
    <comment_count>7</comment_count>
      <attachid>468</attachid>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-04-30 14:17:58 +0000</bug_when>
    <thetext>Created attachment 468
Amended Patch, using XML mode as trigger, matching error number rather than text

Shane, thanks a lot, your patch looks like a good solution. 
I am attaching a patch with a couple proposed modifications:
* use $File-&gt;{Mode} eq &apos;XML&apos; as trigger rather than an option always set to TRUE, so that usage of xmlns prefix in SGML/HTML mode trigger (correct) errors
* match the internal opensp error message code for the attribute, rather than the text of the error message - which should hopefully be a little more robust (opensp is localized in a few languages, so the error message text could be different)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15027</commentid>
    <comment_count>8</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-05-07 14:28:20 +0000</bug_when>
    <thetext>Patch commited to CVS. 
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>466</attachid>
            <date>2007-04-28 03:42:24 +0000</date>
            <delta_ts>2007-04-28 04:01:40 +0000</delta_ts>
            <desc>Patch to implement ignoring xmlns: attribute declaration errors</desc>
            <filename>check.patch</filename>
            <type>text/plain</type>
            <size>1245</size>
            <attacher name="Shane McCarron">shane</attacher>
            
              <data encoding="base64">SW5kZXg6IGNoZWNrDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL3NvdXJjZXMvcHVibGljL3ZhbGlk
YXRvci9odHRwZC9jZ2ktYmluL2NoZWNrLHYNCnJldHJpZXZpbmcgcmV2aXNpb24gMS41MDMNCmRp
ZmYgLXUgLXIxLjUwMyBjaGVjaw0KLS0tIGNoZWNrCTI0IEFwciAyMDA3IDA2OjQ4OjA0IC0wMDAw
CTEuNTAzDQorKysgY2hlY2sJMjggQXByIDIwMDcgMDM6Mzg6MjcgLTAwMDANCkBAIC00MjcsNiAr
NDI3LDcgQEANCiAkRmlsZS0+e09wdH0tPnsnTWF4IEVycm9ycyd9ICAgICA9ICRxLT5wYXJhbSgn
bWUnKSAgICAgID8gJHEtPnBhcmFtKCdtZScpICAgICAgICA6ICAgICAnJzsNCiAkRmlsZS0+e09w
dH0tPnsnUHJlZmlsbCd9ICAgICAgICA9ICRxLT5wYXJhbSgncHJlZmlsbCcpID8gVFJVRSAgICAg
ICAgICAgICAgICAgICA6ICBGQUxTRTsNCiAkRmlsZS0+e09wdH0tPnsnUHJlZmlsbCBEb2N0eXBl
J30gICAgICAgID0gJHEtPnBhcmFtKCdwcmVmaWxsX2RvY3R5cGUnKSA/ICRxLT5wYXJhbSgncHJl
ZmlsbF9kb2N0eXBlJykgICA6ICAgICAnaHRtbDQwMSc7DQorJEZpbGUtPntPcHR9LT57J0lnbm9y
ZSBYTUxOUyBFcnJvcnMnfSAgICAgICAgPSBUUlVFIDsNCiANCiAjDQogIyAiRmFsbGJhY2siIGlu
Zm8gZm9yIENoYXJhY3RlciBFbmNvZGluZyAoZmJjKSwgQ29udGVudC1UeXBlIChmYnQpLA0KQEAg
LTIzNDcsNiArMjM0OCwxNCBAQA0KICAgJGVyci0+e3R5cGV9ID0gJG1lc3MtPntwcmltYXJ5X21l
c3NhZ2V9e1NldmVyaXR5fTsNCiAgICRlcnItPnttc2d9ICA9ICRtZXNzLT57cHJpbWFyeV9tZXNz
YWdlfXtUZXh0fTsNCiANCisgICMgWE1MTlMgYXR0cmlidXRlcyBjYW4gYmUgaWdub3JlZA0KKyAg
aWYgKCRGaWxlLT57T3B0fS0+eydJZ25vcmUgWE1MTlMgRXJyb3JzJ30gPT0gVFJVRSkgew0KKyAg
ICBpZiAoJGVyci0+e21zZ30gPX4gbXt0aGVyZSBpcyBubyBhdHRyaWJ1dGUgInhtbG5zOn0pIHsN
CisgICAgICAgICMgdGhlIGVycm9yIGlzIGFib3V0IGEgbWlzc2luZyB4bWxuczogYXR0cmlidXRl
IGRlZmluaXRpb24iDQorICAgICAgICByZXR1cm4gOyAgIyB0aGlzIGlzIG5vdCBhbiBlcnJvciwg
J2NhdXNlIHdlIHNhaWQgc28NCisgICAgfQ0KKyAgfQ0KKw0KICAgIyAuLi4NCiAgICRGaWxlLT57
J0lzIFZhbGlkJ30gPSBGQUxTRSBpZiAkZXJyLT57dHlwZX0gZXEgJ0UnOw0KIA0K
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>467</attachid>
            <date>2007-04-28 04:01:40 +0000</date>
            <delta_ts>2007-04-30 14:17:58 +0000</delta_ts>
            <desc>Updated against version 1.507</desc>
            <filename>check.patch</filename>
            <type>text/plain</type>
            <size>1245</size>
            <attacher name="Shane McCarron">shane</attacher>
            
              <data encoding="base64">SW5kZXg6IGNoZWNrDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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fXtUZXh0fTsNCiANCisgICMgWE1MTlMgYXR0cmlidXRlcyBjYW4gYmUgaWdub3JlZA0KKyAg
aWYgKCRGaWxlLT57T3B0fS0+eydJZ25vcmUgWE1MTlMgRXJyb3JzJ30gPT0gVFJVRSkgew0KKyAg
ICBpZiAoJGVyci0+e21zZ30gPX4gbXt0aGVyZSBpcyBubyBhdHRyaWJ1dGUgInhtbG5zOn0pIHsN
CisgICAgICAgICMgdGhlIGVycm9yIGlzIGFib3V0IGEgbWlzc2luZyB4bWxuczogYXR0cmlidXRl
IGRlZmluaXRpb24iDQorICAgICAgICByZXR1cm4gOyAgIyB0aGlzIGlzIG5vdCBhbiBlcnJvciwg
J2NhdXNlIHdlIHNhaWQgc28NCisgICAgfQ0KKyAgfQ0KKw0KICAgIyAuLi4NCiAgICRGaWxlLT57
J0lzIFZhbGlkJ30gPSBGQUxTRSBpZiAkZXJyLT57dHlwZX0gZXEgJ0UnOw0KIA0K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>468</attachid>
            <date>2007-04-30 14:17:58 +0000</date>
            <delta_ts>2007-04-30 14:17:58 +0000</delta_ts>
            <desc>Amended Patch, using XML mode as trigger, matching error number rather than text</desc>
            <filename>bug800.patch</filename>
            <type>text/plain</type>
            <size>667</size>
            <attacher name="Olivier Thereaux">ot</attacher>
            
              <data encoding="base64">LS0tIGh0dHBkL2NnaS1iaW4vY2hlY2sgMzAgQXByIDIwMDcgMTM6MzY6MzQgLTAwMDAgICAgICAx
LjUxMworKysgaHR0cGQvY2dpLWJpbi9jaGVjayAzMCBBcHIgMjAwNyAxNDowNjo1OSAtMDAwMApA
QCAtMjMzOSw2ICsyMzM5LDE3IEBACiAgICRlcnItPnt0eXBlfSA9ICRtZXNzLT57cHJpbWFyeV9t
ZXNzYWdlfXtTZXZlcml0eX07CiAgICRlcnItPnttc2d9ICA9ICRtZXNzLT57cHJpbWFyeV9tZXNz
YWdlfXtUZXh0fTsKIAorICAjIG91ciBwYXJzZXIgT3BlblNQIGlzIG5vdCBxdWl0ZSBYTUwtYXdh
cmUsIG9yIFhNTCBOYW1lc3BhY2VzIEF3YXJlLCAKKyAgIyBzbyB3ZSBmaWx0ZXIgb3V0IGEgZmV3
IGVycm9ycyBmb3Igbm93CisKKyAgaWYgKCRGaWxlLT57TW9kZX0gZXEgJ1hNTCcpIHsKKyAgICBp
ZiAoJGVyci0+e251bX0gZXEgJzEwOCcgYW5kICRlcnItPnttc2d9ID1+IG17ICJ4bWxuczpcUysi
fSkgeworICAgICAgIyB0aGUgZXJyb3IgaXMgYWJvdXQgYSBtaXNzaW5nIHhtbG5zOiBhdHRyaWJ1
dGUgZGVmaW5pdGlvbiIKKyAgICAgIHJldHVybiA7ICAjIHRoaXMgaXMgbm90IGFuIGVycm9yLCAn
Y2F1c2Ugd2Ugc2FpZCBzbworICAgIH0KKyAgfQorCisKICAgIyAuLi4KICAgJEZpbGUtPnsnSXMg
VmFsaWQnfSA9IEZBTFNFIGlmICRlcnItPnt0eXBlfSBlcSAnRSc7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>