The XML markup language is less complicated than its name (“Extensible Markup Language”) might lead one to believe: An XML file contains highly structured text - similar to HTML files. However, the structuring of the text is so clear and logical that it can be used to map entire databases. XML is often used for sitemaps which can then be uploaded to the Google Search Console or the Webmaster Tools from Bing.
The trick of XML is the hierarchy and the flexible identification of the contained data: there is always a start tag, such as "<Onpage>" and an associated end tag with prefixed slash: "</ onpage>". Within these two tags, the information contained within a unit belongs to a unit and can be further structured. This can look like this:
<tt> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <onpage> <header> <title-tag>iPhones from iPhone broker</title-tag> <Description>We have the best iPhones in the world</description> </header> <content> <headline>Great iPhones</headline> <Text>If it absolutely needs to be a first class phone, then an iPhone from us. Bla bla bla.</text> <content> </onpage> </tt>
The first line defines the XML version and character encoding. All other lines represent the actual contents of the file. That way, the XML file contains the information to be passed on and the “recipient” knows what to expect in each field.
These tags can be named quite flexibly. This is a crucial difference to HTML, where each tag has a specific function (“strong” for bold and “h1” for a heading). Moreover, you can define the structure of the file with a Document Type Definition (“DTD”) or in an XML schema, which values must be contained, and what kind of values are expected. This file specifies that in the above example a title tag must always exist and that it should be text. And a value such as the file size must always be specified in integers. If the recipient checks the received XML files against the DTD or the XML schema, he will automatically notice errors.
If images or videos have to be transferred in addition to text information, these cannot usually be contained in the XML (same as with HTML), instead a link inserted into the saved file. For two-dimensional graphics, the extension .svg (Scalable Vector Graphics) can be inserted.
XML is used whenever structured transfer or storage of data is required. For example, for product data from a network to Affiliates or for the syndication of content. XHTML (Extensible Hypertext Markup Language) is a specific form of XML, a markup language for web pages. XHTML contains all elements of HTML 4.01 and is mostly downwards compatible, in other words, it can be displayed by browsers which are not XHTML-capable.
XML is defined by W3C, most recently in the fifth version of November 26, 2008. The Validome XML validator can show whether the XML is correct.