Are SVG parameters such as ‘xmlns’ and ‘version’ needed?

The xmlns="http://www.w3.org/2000/svg" attribute is:

  • Required for image/svg+xml files. 1
  • Optional for inlined <svg>. 2

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

  • Required for image/svg+xml files with xlink: attributes. 1
  • Optional for inlined <svg> with xlink: attributes. 2

The version="1.1" attribute is:

  • Recommended to comply with image/svg+xml files standards. 3
  • Apparently ignored by every user agent. 4
  • Removed in SVG 2. 5

1 Internationalized Resource Identifiers (RFC3987)
2 Since HTML5
3 Extensible Markup Language (XML) 1.0
4 Probably until the release of further major versions.
5 SVG 2, W3C Candidate Recommendation, 07 August 2018

Leave a Comment