What is an XML file?
XML stores data as labelled, nested tags. It is wordier than JSON but very precise about structure, and it still sits underneath feeds, office documents and a great deal of business software. You can convert XML files here, both into the format and out of it.
Specification
| Full name | Extensible Markup Language |
|---|---|
| Extensions | .xml |
| Media type | application/xml |
| Compression | Uncompressed |
| Transparency | — |
| Animation | — |
| Multiple pages | — |
| Colour depth | Unicode element tree with namespaces, DTD or XSD validation |
| Size limits | — |
| Introduced | 1998 |
| Developed by | W3C |
| Standard | Open |
| Browser support | Every browser, including older ones |
What XML is used for
- RSS and Atom feeds, and sitemap files for search engines
- Enterprise messaging over SOAP and industry data interchange schemas
- The internal parts of DOCX, XLSX, ODT and EPUB packages
- Configuration in Java, .NET and Android projects
Strengths and limitations
What XML does well
- Schemas allow a document to be validated before it is processed
- Namespaces let independent vocabularies be mixed in one document
- Mature tooling for querying and transforming with XPath and XSLT
Where XML falls short
- Very verbose, with every element name repeated in its closing tag
- The attribute versus child element choice makes mapping to objects messy
- Entity expansion features have caused a long line of security problems
Convert XML to
Every target this format can be written out as, each on its own page.
Convert to XML
Everything that can be turned into a XML file.
Questions about XML
What is a .xml file?
XML stores data as labelled, nested tags. The extension .xml identifies it, and its media type is application/xml.
How do I open an XML file?
Any current browser will open it directly, so dragging the file into a tab is usually enough. Most operating systems also preview it without extra software.
Is XML lossy or lossless?
Uncompressed. Nothing is discarded, so repeated saves never degrade the contents.
What is XML good for?
Schemas allow a document to be validated before it is processed. Namespaces let independent vocabularies be mixed in one document. Mature tooling for querying and transforming with XPath and XSLT. In practice that makes it a good fit for RSS and Atom feeds, and sitemap files for search engines, and Enterprise messaging over SOAP and industry data interchange schemas.
What are the drawbacks of XML?
Very verbose, with every element name repeated in its closing tag. The attribute versus child element choice makes mapping to objects messy. Entity expansion features have caused a long line of security problems.