Skip to main content
HTML Validation

Bad value X for the attribute “xmlns:link” (only “http://www.w3.org/1999/xlink” permitted here).

About This HTML Issue

The xmlns:xlink attribute on inline SVG accepts only one value, http://www.w3.org/1999/xlink.

The message calls the attribute xmlns:link, but the one to look for in your markup is xmlns:xlink. It declares the XLink namespace, which SVG 1.1 used for attributes such as xlink:href. A namespace URI is a fixed name that the browser never loads, so it has to match the specification character for character. A different year, a trailing slash, https instead of http, or a path segment rewritten by a build tool or a search and replace all trigger this error.

In an HTML document you don't need the declaration at all. The HTML parser puts xlink:href and the other xlink: attributes in the XLink namespace by itself, and SVG 2 lets you write plain href on <use>, <image> and <a>. Either correct the value or remove the attribute and switch xlink:href to href.

Invalid example

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/2000/xlink" viewBox="0 0 24 24" width="24" height="24">
  <use xlink:href="#icon-star"></use>
</svg>

Valid example

Correct the namespace URI:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="24" height="24">
  <use xlink:href="#icon-star"></use>
</svg>

Or drop the declaration and use href:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
  <use href="#icon-star"></use>
</svg>

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?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries