# Bad value https://www.w3.org/1998/Math/MathML for the attribute xmlns (only http://www.w3.org/1998/Math/MathML permitted here).

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-https-www-w3-org-1998-math-mathml-for-the-attribute-xmlns-only-http-www-w3-org-1998-math-mathml-permitted-here
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Namespace URIs in XML (and by extension in HTML) are **identifiers**, not actual URLs that a browser fetches. The W3C and WHATWG specifications define `http://www.w3.org/1998/Math/MathML` as the one and only valid namespace for MathML. Even though `http://` and `https://` point to the same server in practice, they are different strings — and namespace matching is purely a string comparison. Using `https://www.w3.org/1998/Math/MathML` creates what the spec considers an entirely different (and unrecognized) namespace.

This is a common mistake because modern best practices encourage using `https://` for everything on the web. However, these namespace URIs were standardized long before HTTPS became the norm, and changing them would break backward compatibility across the entire XML ecosystem. The spec is explicit: only `http://www.w3.org/1998/Math/MathML` is permitted.

## How to Fix It

You have two options depending on your document type:

1. **HTML5 (recommended):** Simply remove the `xmlns` attribute from the `<math>` element. The HTML5 parser recognizes `<math>` and automatically places it in the correct MathML namespace. No explicit declaration is needed.

2. **XHTML or XML documents:** If you're serving your document as `application/xhtml+xml` or working in an XML context where explicit namespaces are required, use the exact URI `http://www.w3.org/1998/Math/MathML` with `http://`.

The same rule applies to other well-known namespaces like SVG (`http://www.w3.org/2000/svg`) and XHTML (`http://www.w3.org/1999/xhtml`) — always use the `http://` form specified in the standard.

## Examples

### Invalid: using `https://` in the namespace URI

The `https://` scheme causes the validation error:

```html
<math xmlns="https://www.w3.org/1998/Math/MathML">
  <mi>x</mi><mo>+</mo><mn>1</mn>
</math>
```

### Fixed: omit `xmlns` in HTML5

In an HTML5 document, the parser handles the namespace automatically, so the cleanest fix is to drop `xmlns` altogether:

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <title>MathML Example</title>
</head>
<body>
  <math>
    <mi>x</mi><mo>+</mo><mn>1</mn>
  </math>
</body>
</html>
```

### Fixed: use the correct `http://` URI

If you need to explicitly declare the namespace (for example, in XHTML served as XML), use the exact `http://` URI:

```html
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mi>x</mi><mo>+</mo><mn>1</mn>
</math>
```

### Quick comparison

| Code | Valid? |
|---|---|
| `<math xmlns="https://www.w3.org/1998/Math/MathML">` | ❌ Wrong scheme |
| `<math xmlns="http://www.w3.org/1998/Math/MathML">` | ✅ Correct URI |
| `<math>` (in HTML5) | ✅ Namespace implied |
