This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9967 - don't switch to XHTML5 checking on HTML5 direct input that has xmlns="http://www.w3.org/1999/xhtml"
Summary: don't switch to XHTML5 checking on HTML5 direct input that has xmlns="http://...
Status: RESOLVED FIXED
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 04:21 UTC by Michael[tm] Smith
Modified: 2015-08-23 07:07 UTC (History)
3 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2010-06-21 04:21:10 UTC
Steps to reproduce:

1. Enter the following as direct input:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<title></title>

You'll notice that you get two errors:

  - Line 3, Column 7: XHTML element title not allowed as child of XHTML element html in this context. (Suppressing further errors from this subtree.)

  - Line 3, Column 16: premature end of file (found [EOF])
 
You should instead get no errors. The direct input should by default just be treated as text/html instead, not XHTML. The 'xmlns="http://www.w3.org/1999/xhtml"' part is not necessarily any indication that the author intends for it to be processed as XHTML.

For details, see:

http://dev.w3.org/html5/spec/elements.html#global-attributes
[[
In HTML documents, elements in the HTML namespace may have an xmlns attribute specified, if, and only if, it has the exact value "http://www.w3.org/1999/xhtml". This does not apply to XML documents.

In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XHTML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace, not the "http://www.w3.org/2000/xmlns/" namespace like namespace declaration attributes in XML do.
]]
Comment 1 Ville Skyttä 2011-08-23 21:53:04 UTC
Done in Mercurial, testable at http://qa-dev.w3.org/wmvs/HEAD/
Comment 2 Filipus Klutiero 2011-09-10 14:56:56 UTC
Here is another way in which this manifests.

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>                        HomePage </title>
</head>
<body> </body>
</html>

The above, which is clearly in "HTML HTML syntax", is also interpreted as XHTML, and most confusingly, the validator whines it's not valid XHTML on the declaration that it is in "HTML HTML syntax":

"Bad value Content-Type for attribute http-equiv on XHTML element meta"
Comment 3 Sergei Shoshin 2012-03-14 16:44:34 UTC
so is there now any option to validate xhtml5 code via direct input?
Comment 4 Michael[tm] Smith 2012-03-20 04:41:38 UTC
(In reply to comment #3)
> so is there now any option to validate xhtml5 code via direct input?

The option is to use http://validator.w3.org/nu/ instead.