What is the default namespace for HTML / HTML5?

According to this page, some user named "w3c" default namespace for HTML:

http://www.w3.org/1999/xhtml

He was clearly mistaken since xhtml was used for the failed XML4-based XML standard. What is the correct namespace should I use?

Background: I am writing an application using XML. I want to be able to store data in an XML node using namespaces. For example,

<s:Button width="100" height="100" html:color="blue" color="black" /> 

The XML parser requires a namespace for the "html" prefix.

+4
source share
2 answers

W3C, XML, HTML (WHATWG HTML 5, W3C, WHATWG W3C REC), HTML XML ( XHTML) http://www.w3.org/1999/xhtml.

HTML XML, , XHTML 1.0 1.1, , XHTML 2.0, , , , , , "HTML5 XML", XHTML5.

, HTML 5, WHATWG, , , HTML5 XML, http://www.w3.org/1999/xhtml , . Per https://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F:

XHTML .

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

HTML xmlns HTML, " http://www.w3.org/1999/xhtml". , XHTML1. HTML, HTML . . , HTML.

FAQ :

HTML DOM, /html HTML HTML, http://www.w3.org/1999/xhtml. , XHTML, HTML (. ). , HTML, XHTML. , xmlns HTML, http://www.w3.org/1999/xhtml.

, HTML MathML SVG. , math svg, MathML SVG, , . , xmlns , .

, HTML XML, MathML SVG, xmlns , , DOM .

+7

XHTML

required XHTML :

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

xmlns XHTML [XMLNS]. XHTML http://www.w3.org/1999/xhtml

HTML5

HTML5:

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

... HTML, XHTML. xmlns. HTML, http://www.w3.org/1999/xhtml

+3

Source: https://habr.com/ru/post/1621184/


All Articles