Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For standalone SVG(.svg files), is it mandatory to include the the DOCTYPE and the XML declaration?

Tags:

svg

For standalone SVG(.svg files), is it mandatory to include the the DOCTYPE and the XML declaration ?

like image 585
Praveen Murali Avatar asked Oct 14 '25 02:10

Praveen Murali


1 Answers

A doctype is not required some people recommend not using it

In XML 1.1 the XML declaration is mandatory though. If it's omitted the document is supposed to be treated as XML 1.0 which may or may not be what you wanted. Note that browsers don't enforce this requirement so if that's your only use case you can omit the XML declaration.

like image 188
Robert Longson Avatar answered Oct 20 '25 01:10

Robert Longson