XML (Extensible Markup Language) is a data specification developed in 1998 by the W3C (World Wide Web Consortium). It is a text format that allows data to be saved in a format that is easy to read by both machines and humans.
To better visualise an XML file, it’s easier to compare it with the popular markup language, Hypertext Markup Language (HTML), widely used to encode web pages. The main difference between these languages is that XML can be extended because there is no predefined markup language (as in HTML). Users can create symbols that will describe the content. In this way, XML becomes an unlimited language.
For XML data to be considered valid, it must have some structure. An XML document consists of nested elements. They are saved as tags in the form <tag> </tag>.
The basic XML language elements are:
- Attributes – Elements can have any number of attributes.
- Namespaces – Element names, elements and attributes may contain a so-called “namespace.”
- Comments – You can leave comments inside an XML document
- Prologue – This is the component added at the beginning of an XML document. The XML document should contain a prologue. Part of the prologue is the declaration <? XML version = “1.0” encoding = “UTF-8”?> It contains information about the XML version we are using
Due to XML’s well-defined structure and a massive set of tools, documents in XML format are very popular. Dedicated tools for working with XML are available in many programming languages. XML documents are great for saving all kinds of settings.