HTML Guide for namespace
The xmlns:m attribute is an XML namespace declaration and not valid on the html element in HTML documents.
HTML5 does not support custom XML namespaces; they are only used in XML-based languages such as XHTML. The global xmlns:* attributes like xmlns:m are not allowed on the <html> element in HTML documents that use the text/html MIME type. This causes serialization and validation errors, especially with W3C HTML validation.
To fix this, remove the xmlns:m attribute from the <html> tag. If you need to use a namespace, your document should be XHTML and served as application/xhtml+xml, not as regular HTML.
Incorrect HTML (causes validation error):
<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
<head>
<title>Invalid Namespace Example</title>
</head>
<body>
<!-- Content -->
</body>
</html>
Correct HTML (remove the namespace declaration):
<!DOCTYPE html>
<html lang="en">
<head>
<title>Valid HTML Example</title>
</head>
<body>
<!-- Content -->
</body>
</html>
If you require usage of MathML, SVG, or other XML vocabularies, HTML5 already supports them natively without explicit namespace declarations. For Microsoft Office Markup Language (OMML), use proper XML/XHTML serialization and the correct MIME type if absolutely necessary. For typical web content, avoid custom XML namespaces in HTML5.
Remove the xmlns:svg attribute from the <svg> element, leaving only the valid xmlns attribute.
The xmlns attribute defines the XML namespace for the SVG and is correctly set to http://www.w3.org/2000/svg. The xmlns:svg attribute attempts to declare a prefixed namespace, which is unnecessary and invalid in both HTML and SVG served as XML (or embedded in HTML). The W3C validator flags this because HTML5 does not allow arbitrary XML namespace declarations beyond the standard SVG namespace; such prefixes are not used in HTML serialization.
Incorrect usage:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<!-- SVG content -->
</svg>
Correct usage:
<svg xmlns="http://www.w3.org/2000/svg">
<!-- SVG content -->
</svg>
Only xmlns="http://www.w3.org/2000/svg" is required for inline SVG in HTML.
The xmlns:v attribute is not valid in HTML5 and should be removed to ensure compliance with W3C standards.
The xmlns:v namespace attribute was historically used for VML (Vector Markup Language), mainly in legacy support for Internet Explorer. Modern HTML, particularly the living standard and HTML5, does not permit namespace declarations using xmlns attributes like xmlns:v. These are only valid in XML-based serializations, such as XHTML. Including xmlns:v in a standard HTML5 document results in validation errors because HTML does not support custom namespaces.
Incorrect HTML:
<!DOCTYPE html>
<html xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
<head>
<title>VML Namespace Example</title>
</head>
<body>
<!-- Content -->
</body>
</html>
Corrected HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>VML Namespace Removed</title>
</head>
<body>
<!-- Content -->
</body>
</html>
Remove the xmlns:v attribute entirely to resolve the validator warning and ensure your HTML meets current standards. If you are not using VML, no further changes are necessary. If you require vector graphics, use SVG instead, which is fully supported in HTML5.
Ensure the xmlns attribute for <svg> elements is set to “http://www.w3.org/2000/svg”.
In HTML documents, the xmlns attribute in an <svg> element must be defined correctly. The xmlns attribute specifies the XML namespace for an SVG element, which should always be “http://www.w3.org/2000/svg”. If you receive a validation error indicating a bad value for xmlns, it means that the attribute is empty or incorrectly set. This namespace ensures that the SVG elements are properly recognized as SVGs by the browser and aids in maintaining proper structure and function.
Here’s a correct example of an <svg> element:
<!DOCTYPE html>
<html lang="en">
<body>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>
</body>
</html>
Ensure that every <svg> element you use includes the xmlns attribute with the correct value to avoid validation issues and ensure complete browser compatibility.
The only permitted value for the xmlns:link attribute is http://www.w3.org/1999/xlink.
Although using https in the URL looks like it’s going to be more secure, in fact this URL is not used to connect it to, only to declare the namespace.
The only permitted value for the xmlns attribute is http://www.w3.org/2000/svg.
The namespace declaration for an <svg> element is provided by the xmlns attribute like this:
<svg xmlns="http://www.w3.org/2000/svg">
<!-- more tags here -->
</svg>
Although using https in the URL looks like it’s going to be more secure, in fact this URL is not used to connect it to, only to declare the namespace.