According to this page by some user named "w3c" the default namespace for HTML is:
http://www.w3.org/1999/xhtml
He's obviously wrong since xhtml was used for a failed XML based HTML4 standard. What is the correct namespace I should use?
Background: I'm writing an app that uses XML. I want to be able to save data on the XML node using namespaces. For example,
<s:Button width="100" height="100" html:color="blue" color="black" />
The XML parser needs a namespace for the "html" prefix to be valid.
As documented by the W3C, who are the body behind both the XML and HTML specifications (WHATWG has a separate HTML 5 spec, but while it in some ways out of sync with the W3C spec, WHATWG does still consider it the W3C's role to bring standardise a spec as a REC), the namespace for HTML when used with an XML serialisation (which is sometimes refered to as XHTML) is
http://www.w3.org/1999/xhtml
.This namespace covers all versions of HTML with such XML serialisations that have been specified so far including XHTML 1.0 and 1.1 which were in considerable use for over a decade, XHTML 2.0 which introduced several modular ideas but which was arguably of more import as an incubator for several ideas than as an implemented version, and "HTML5 serialized as XML" which is sometimes called XHTML5.
Since the other body with a horse in the race as to just how HTML 5 is specified is WHATWG, you may note that they also say that if you are serialising HTML5 as XML then you must use the namespace
http://www.w3.org/1999/xhtml
and with the other serialisation either not use a namespace, or use that one. Per https://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F:The next FAQ is also relevant here:
XHTML
The following default namespace declaration is required in XHTML for strictly conforming documents:
HTML5
The same default namespace declaration is optional in HTML5: