1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Files
svgo/docs/04-plugins/removeXMLProcInst.mdx
2024-06-16 00:10:42 +01:00

21 lines
1023 B
Plaintext

---
title: removeXMLProcInst
svgo:
pluginId: removeXMLProcInst
defaultPlugin: true
---
Removes the [XML declaration](https://developer.mozilla.org/docs/Web/XML/XML_introduction#xml_declaration) from the document.
The SVG language is based on XML, and is XML compatible, so editors often include an XML declaration.
An XML declaration is the line at the top of an XML file to indicate document meta-data, like encoding and which version of the XML specifications it adheres to.
```xml
<?xml version="1.0" encoding="UTF-8"?>
```
The XML declaration is optional in [XML 1.0](https://www.w3.org/TR/REC-xml/#sec-prolog-dtd), but mandatory in the [XML 1.1](https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-prolog-dtd). If the XML declaration is omitted, the document is assumed to follow the XML 1.0 specifications, which won't impact SVG documents.
It can be safely removed without impacting compatibility with SVG clients. However, some tools may fail to detect the MIME-type as `image/svg+xml` if this is removed.