From two articles on stackoverflow and an MDN article:
Include the prolog:
<?xml version="1.0" encoding="utf-8"?>
Include a DTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
The xmlns
attribute of the <svg>
root element is required and the version
attribute is recommended; the xmlns:xlink
attribute is required only if the document uses xlink
:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
The prolog should not be included.
The DTD should not be included.
The version
attribute is recommended, but is ignored by every user agent.
The xmlns
, and xmlns:xlink
attributes are not required.