Skip to main content
HTML Validation

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

About This HTML Issue

HTML5 uses a specific serialization format that is distinct from XML. While XML allows you to declare arbitrary namespace prefixes using xmlns:prefix attributes, the HTML parser does not recognize or process these declarations. The HTML specification only supports a small set of predefined namespaces — the default HTML namespace, SVG (http://www.w3.org/2000/svg), MathML (http://www.w3.org/1998/Math/MathML), XLink, XML, and XMLNS — and these are handled implicitly through the appropriate embedding elements (<svg>, <math>), not through explicit xmlns: declarations.

The phrase “not serializable as XML 1.0” in the validator message means that this attribute cannot be round-tripped between the HTML parser and an XML serializer. The HTML parser treats xmlns:w as an opaque attribute name containing a colon, rather than as a namespace declaration. If you were to serialize this DOM back to XML, the result would be invalid because xmlns:w would be interpreted as a namespace declaration for a prefix that may conflict with actual element usage.

This issue almost always originates from content exported or pasted from Microsoft Word, Excel, or other Office applications. These tools generate markup laden with proprietary namespace declarations like xmlns:w, xmlns:o (Office), xmlns:v (VML), and xmlns:x (Excel). Along with these declarations come Office-specific elements and attributes (e.g., <w:WordDocument>, <o:OfficeDocumentSettings>) that have no meaning in a web browser and bloat your HTML.

Beyond being a validation error, leaving this markup in place creates several problems. It adds significant unnecessary weight to your pages, makes the source code harder to read and maintain, and signals that the HTML was auto-generated without cleanup — which can affect long-term maintainability. Browsers silently ignore these attributes and elements, so they provide no functional benefit.

How to fix it

  1. Remove all xmlns: prefixed attributes from your HTML elements, including xmlns:w, xmlns:o, xmlns:v, xmlns:x, and any others.
  2. Remove any Office-specific elements that use those namespace prefixes, such as <o:p>, <w:WordDocument>, or <v:shapetype>. These elements are meaningless in HTML5.
  3. Clean up associated conditional comments like <!--[if gte mso 9]> that often wrap Office-specific blocks.
  4. Consider using a paste-cleanup tool if you regularly paste content from Word into your HTML. Many CMS platforms and text editors offer “paste as plain text” or “clean HTML” options.

If you genuinely need to work with Office Open XML namespaces, use an appropriate XML-based format (XHTML served as application/xhtml+xml, or OOXML documents) rather than standard HTML5.

Examples

Incorrect — Office namespace declarations in HTML

This markup is typical of content saved or exported from Microsoft Word:

<html xmlns:w="urn:schemas-microsoft-com:office:word"
  xmlns:o="urn:schemas-microsoft-com:office:office"
  xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <title>Report</title>
    <!--[if gte mso 9]>
    <w:WordDocument>
      <w:View>Normal</w:View>
    </w:WordDocument>
    <![endif]-->
  </head>
  <body>
    <p class="MsoNormal">Hello world<o:p></o:p></p>
  </body>
</html>

Correct — Clean HTML without Office markup

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Report</title>
  </head>
  <body>
    <p>Hello world</p>
  </body>
</html>

Incorrect — Single namespace on the <html> element

Even a single custom namespace declaration triggers the error:

<html xmlns:w="urn:schemas-microsoft-com:office:word">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Content here.</p>
  </body>
</html>

Correct — Remove the attribute entirely

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Content here.</p>
  </body>
</html>

Note that the default xmlns="http://www.w3.org/1999/xhtml" attribute on the <html> element is permitted (though unnecessary in HTML5), but any prefixed namespace declaration like xmlns:w is not.

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 trial today.