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

> Canonical HTML version: https://rocketvalidator.com/html-validation/attribute-with-the-local-name-xmlns-rdf-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/)

Custom namespace declarations like `xmlns:rdf` are not serializable as XML 1.0 when used inside HTML5 documents.

In HTML5 (the `text/html` serialization), the `xmlns` attribute is only supported in a very limited way. You can use `xmlns` to declare the default namespace on the `<html>` or `<svg>` element, but you cannot declare additional namespace prefixes like `xmlns:rdf`, `xmlns:dc`, or `xmlns:cc`. These prefixed namespace declarations are a feature of XML and XHTML, and the HTML5 parser simply treats them as regular attributes — which then fail XML 1.0 serialization rules.

This commonly happens when SVG files are exported from tools like Inkscape, which embed RDF metadata with namespace declarations. When you paste or include such SVGs directly in an HTML5 document, the validator flags these attributes.

The fix is straightforward: remove the unsupported namespace declarations and any elements that depend on them. If the SVG contains `<rdf:RDF>`, `<cc:Work>`, or `<dc:title>` blocks, those can be safely removed without affecting the visual rendering of the SVG.

## HTML Examples

### ❌ Invalid: SVG with unsupported namespace declarations

```html
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:cc="http://creativecommons.org/ns#"
  viewBox="0 0 100 100">
  <metadata>
    <rdf:RDF>
      <cc:Work rdf:about="">
        <dc:title>My Icon</dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <circle cx="50" cy="50" r="40" fill="blue" />
</svg>
```

### ✅ Valid: SVG with namespace declarations and metadata removed

```html
<svg viewBox="0 0 100 100">
  <circle cx="50" cy="50" r="40" fill="blue" />
</svg>
```

If you need to preserve metadata, consider adding it outside the SVG using standard HTML elements like `<meta>` tags or structured data formats such as JSON-LD.
