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

> Canonical HTML version: https://rocketvalidator.com/html-validation/attribute-with-the-local-name-xmlns-dt-is-not-serializable-as-xml-1-0
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

In XML-based formats like XHTML 1.0 or other XML vocabularies, namespace declarations such as `xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"` were used to associate element or attribute prefixes with specific namespace URIs. This allowed different XML vocabularies to coexist in a single document without naming conflicts. The `xmlns:dt` namespace in particular was commonly associated with Microsoft's XML data types, often seen in legacy ASP or older Microsoft-generated HTML.

HTML5, however, does not use the XML namespace mechanism. The HTML parser treats the document as HTML, not XML, and does not recognize or process custom namespace prefixes. The only `xmlns`-related attributes permitted in HTML5 are:

- `xmlns` on the `<html>` element, but only with the value `http://www.w3.org/1999/xhtml` (for compatibility with XHTML-serving scenarios).
- Implicit namespace handling for embedded `<svg>` and `<math>` elements, which the HTML parser manages automatically.

Any other `xmlns:*` attribute — such as `xmlns:dt`, `xmlns:o`, `xmlns:v`, or `xmlns:st1` — is invalid in HTML5 and will trigger the W3C validator error: **"Attribute with the local name 'xmlns:dt' is not serializable as XML 1.0."**

## Why this is a problem

- **Standards compliance:** Custom XML namespace attributes violate the HTML5 specification. The HTML parser does not process them, so they serve no functional purpose.
- **Serialization issues:** If the document is ever round-tripped through an XML serializer (for example, when converting HTML to XHTML), these attributes cannot be properly serialized under XML 1.0 rules, potentially causing parsing failures.
- **Legacy baggage:** These attributes typically appear in documents generated by older tools (such as Microsoft Word's "Save as HTML" feature) and carry over data-type or Office-specific namespace declarations that are meaningless in a modern web context.
- **Document bloat:** Keeping unused namespace declarations adds unnecessary bytes to your document without any benefit.

## How to fix it

1. **Search your HTML** for any attributes starting with `xmlns:` on the `<html>` element or elsewhere in the document.
2. **Remove them entirely.** If your code relied on XML data types or Office-specific features tied to these namespaces, you'll need to refactor that logic using standard HTML5 attributes (such as `data-*` attributes) or JavaScript.
3. **Ensure your document** uses a standard HTML5 `<!DOCTYPE html>` declaration and a clean `<html>` tag.

If you're working with content pasted from Microsoft Word or similar tools, consider running it through an HTML cleaner to strip out all Office-specific markup.

## Examples

### Incorrect — custom xmlns:dt attribute

This triggers the validation error because `xmlns:dt` is not a valid attribute in HTML5:

```html
<html xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Hello world</p>
  </body>
</html>
```

### Incorrect — multiple custom namespace declarations

Documents exported from older tools often include several invalid namespace attributes at once:

```html
<html xmlns:o="urn:schemas-microsoft-com:office:office"
  xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
  xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Hello world</p>
  </body>
</html>
```

### Correct — clean HTML5 document

Remove all custom `xmlns:*` attributes and use a standard HTML5 structure:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My Page</title>
  </head>
  <body>
    <p>Hello world</p>
  </body>
</html>
```

### Correct — using data attributes as a replacement

If you previously relied on namespace-prefixed attributes to store custom data on elements, use `data-*` attributes instead:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My Page</title>
  </head>
  <body>
    <p data-type="datetime">2024-01-15</p>
  </body>
</html>
```
