Skip to main content

XML namespace

XLink

The generic way to express a hyperlink in any XML vocabulary. Most visible today as xlink:href in SVG, WSDL and DocBook.

xmlns:xlink="http://www.w3.org/1999/xlink"

XLink was designed as a universal linking layer for XML, with simple and extended links, arcs and traversal rules. Almost none of that was adopted; what survived is the attribute xlink:href, which several major vocabularies use for exactly the job HTML gives to href.

SVG is where most people meet it. <use xlink:href="#icon"> was the way to reference another element for years — SVG 2 deprecated it in favour of a plain href attribute, so both forms are in the wild and older renderers only understand the prefixed one.

Because the attribute is namespaced, a document using it must declare the namespace even though the attribute looks self-explanatory. Stripping an apparently unused xmlns:xlink is a reliable way to break an icon sprite.

URI
http://www.w3.org/1999/xlink
Prefix
xlink
Elements
Contributes attributes only

Specification: XLink 1.1

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.