Skip to main content
HTML Validation

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

About This HTML Issue

The W3C HTML Validator raises this error when it encounters a namespaced attribute such as xmlns:m, xmlns:o, xmlns:v, or any other xmlns:* declaration in an HTML document. These prefixed namespace bindings are an XML concept defined in the XML Namespaces specification. In the HTML syntax (documents served with the text/html MIME type), the HTML parser does not treat these as namespace declarations — it treats them as regular attributes with a colon in the name. Because such attribute names are not serializable in XML 1.0, the validator reports the error.

This issue is extremely common with content exported from Microsoft Office (Word, Excel, PowerPoint). When you save or copy Office content as HTML, the generated markup often includes namespace declarations like xmlns:m (Office Math Markup Language), xmlns:o (Office namespace), xmlns:v (VML), and xmlns:w (Word-specific markup). These declarations were designed for older, XML-based HTML rendering and serve no purpose in modern HTML5 documents.

Why This Is a Problem

  • Standards compliance: The HTML5 specification only permits the xmlns attribute (without a prefix) on the <html> element, and only with the value http://www.w3.org/1999/xhtml. Prefixed forms like xmlns:m are not allowed.
  • Serialization: If a tool attempts to serialize the DOM as XML (for example, XMLSerializer), attributes with colons that aren’t properly bound namespaces can cause failures or unexpected output.
  • No functional benefit: In an HTML document, the browser’s HTML parser ignores these namespace bindings. They don’t enable any special behavior — they’re dead weight in your markup.
  • Maintainability: Leaving Office-generated namespace clutter in your HTML makes the code harder to read and maintain.

How to Fix It

  1. Remove the xmlns:* attribute from your HTML element (or whichever element it appears on). In most cases, this is all you need to do — the namespaced content from Office isn’t rendered by browsers anyway.
  2. Clean up Office-generated HTML by stripping out all proprietary namespaces, conditional comments, and Office-specific elements. Tools like HTML Tidy or your editor’s “paste as plain text” feature can help.
  3. Use native HTML5 equivalents where possible. HTML5 natively supports MathML and SVG without requiring explicit namespace declarations.
  4. Switch to XHTML only if you have a genuine need for XML namespaces. This means serving the document with the application/xhtml+xml MIME type and using well-formed XML syntax throughout.

Examples

Incorrect: Office-generated namespace declarations

This markup, typical of content exported from Microsoft Word, triggers the validation error:

<!DOCTYPE html>
<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
      xmlns:o="urn:schemas-microsoft-com:office:office"
      xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <title>Office Export</title>
  </head>
  <body>
    <p>Content from Word</p>
  </body>
</html>

Correct: Clean HTML5 without namespace declarations

Remove all xmlns:* attributes and any associated Office-specific markup:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Office Export</title>
  </head>
  <body>
    <p>Content from Word</p>
  </body>
</html>

Incorrect: Single namespace on a non-html element

The error can also appear on other elements if a tool inserts namespace attributes:

<div xmlns:custom="http://example.com/ns">
  <p>Some content</p>
</div>

Correct: Remove the namespace attribute

<div>
  <p>Some content</p>
</div>

Using MathML natively in HTML5

If the xmlns:m attribute was added to support math content, note that HTML5 supports MathML directly without any namespace declaration:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>MathML in HTML5</title>
  </head>
  <body>
    <p>The quadratic formula:</p>
    <math>
      <mi>x</mi>
      <mo>=</mo>
      <mfrac>
        <mrow>
          <mo>-</mo>
          <mi>b</mi>
          <mo>±</mo>
          <msqrt>
            <msup><mi>b</mi><mn>2</mn></msup>
            <mo>-</mo>
            <mn>4</mn><mi>a</mi><mi>c</mi>
          </msqrt>
        </mrow>
        <mrow>
          <mn>2</mn><mi>a</mi>
        </mrow>
      </mfrac>
    </math>
  </body>
</html>

No xmlns:m attribute is needed — the browser recognizes <math> as MathML automatically.

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?

Ready to validate your sites?
Start your free trial today.