Here’s a typical root svg
element of an Inkscape SVG document with a number of namespace declarations and other attributes:
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:docname="file.svg" width="1052.3622" height="744.09448" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0">
SVG uses the SVG namespace (http://www.w3.org/2000/svg
) for its own elements and the XLink namespace (http://www.w3.org/1999/xlink
) for the linking attributes (A.9 Linking). On top of that, Inkscape adds elements and attributes in the namespaces belonging to Inkscape (http://www.inkscape.org/namespaces/inkscape
) and its predecessor Sodipodi (http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd
; see 1.6 The Life of an Open Source Application for a brief history of Inkscape). Other namespaces declared here are used for metadata elements (general information about the document) and license identifiers (A.4 Defs, View, and Metadata).
The only attributes on the root element that are defined in the SVG standard are width
and height
(defining the size of the canvas), id
, and version
. The rest are either namespace declarations or attributes in the custom Inkscape/Sodipodi namespaces.
This root tag specifies the version of Inkscape in which this document was created: inkscape:version="0.46"
. It also claims that the version of Sodipodi that this document will work with is 0.32 (sodipodi:version="0.32"
), because after that version Inkscape forked off Sodipodi. The non-namespaced version
attribute refers to the version of the SVG specification this document implements, 1.0.
The only difference between the Inkscape SVG and the Plain SVG formats that Inkscape offers when saving is that Plain SVG strips away all the elements and attributes in Inkscape and Sodipodi namespaces, leaving only the “industry standard” namespaces. Note that no Inkscape-specific elements or attributes are ever allowed to alter how the document looks; they can only affect the way it behaves when edited in Inkscape (for example, an attribute on a g
element may tell Inkscape to edit that element as a 3D box instead of a simple group, see 11.3 3D Boxes). Therefore, saving as a Plain SVG is just a way to make a file a little smaller at the cost of losing some of its Inkscape editability. If you find a file that renders differently after being saved as Plain SVG, you’ve found a bug: Please report it to the developers!