Skip to main content

HTML Guide

Attribute with the local name “xmlns:svg” is not serializable as XML 1.0.

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.

Learn more:

Related W3C validator issues