By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,130 Members | 2,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,130 IT Pros & Developers. It's quick & easy.

xmlns attribute produces XHTML validation error.

P: n/a
I have an xmlns attribute that produces an XHTML validation error and I
do not understand why it is considered an error.The file displays as
expected on Firefox and IE7.

http://emle.sourceforge.net/emle0201...001-e.xml.html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html dir="ltr" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>NG 2007-06-25</title>
</head>
<body>
<h1>NG 2007-06-25</h1>
<xhtml:p xmlns="http://emle.sourceforge.net/emle020100"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
Test
</xhtml:p>
</body>
</html>

When I run it through the W3C validator it identifies several errors.

http://validator.w3.org/check?uri=ht...00=1&verbose=1
Error Line 13, column 15: there is no attribute "xmlns" .

<xhtml:p xmlns="http://emle.sourceforge.net/emle020100"
_HTML & XHTML The Definitive Guide_ (6th Edition) by Musciano & Kennedy
section 16.2.2, page 497:
...the xmlns attribute... You can place it within the start tag of any
element within your document...
The example with the error is a reduced version of the results produced
by:
http://emle.sourceforge.net/emle0201...le_lab_001.xml
For more context of what I am working upon see:
http://emle.sourceforge.net/emle0201...0_context.html

--
C.W.Holeman II | cw***@Julian5Locals.com-5 http://JulianLocals.com/cwhii
To only a fraction of the human race does God give the privilege of
earning one's bread doing what one would have gladly pursued free, for
passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
Jun 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 25 Jun, 16:47, "C.W.Holeman II" <cwhii_google_s...@yahoo.com>
wrote:
I have an xmlns attribute that produces an XHTML validation error and I
do not understand why it is considered an error.
Take it to c.i.w.a.h if you want to _understand_ why (and put your
flame-proof pants on first)

The root of it is this:
Content-Type: text/html

You're not using XHTML, you're using XHTML Appendix C. It's XML
content, but sent out deliberately mis-labelled as HTML so that it
gets processed as HTML (ie SGML) and thus makes IE work. It's a hack,
but it's still the only way to serve XHTML to the majority of
browsers.

Under Appendix C, you can't do namespacing (meaningless in SGML), so
of course your code is invalid.

It's also arguable that you can't do Appendix C for XHTML 1.1 and can
only do it for XHTML 1.0

Jun 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.