Markup language XML it is less complicated than its name ("Extensible Markup Language") may lead you 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 frequently used for sitemaps that can be uploaded to the Google Search Console or Bing Webmaster Tools.
Structure
The trick of XML is the hierarchy and flexible identification of the contained data: there is always a starting tag, such as "" and an associated ending tag with a prefixed backslash: "". Within these two labels, the information contained in a unit belongs to a unit and can be further structured. This may look like this:
Best iPhones If a top-notch phone is absolutely necessary, then an iPhone from us. Bla bla bla.
The first line sets the XML version and character encoding. All other lines represent the actual content of the file. In this way, the XML file it contains the information to be transmitted and the "recipient" knows what to expect in each field.
Defining labels
These labels can be named very flexibly. This is a crucial difference from HTML, where each tag has a specific function ("strong" for bold and "h1" for a heading). At the same time, you can define the structure of the file with a Document Type Definition ("DTD") or in an XML schema, what values should be contained and what kind of values are expected. This file specifies that in the previous example there must always be a title tag and what must be text. And a value such as file size must always be specified in whole numbers. If the recipient compares the received XML files with the DTD or XML schema, it will automatically detect errors.
If there are images or videos to be transferred at the same time as the text information, normally they cannot be contained in XML (as with HTML), but in a link inserted in the saved file. For two-dimensional graphics, the width .svg (Scalable Vector Graphics) can be inserted.
Formats
XML is used when a structured transfer or storage of data is required. For example, for product data from an affiliate network or for content syndication. XHTML (Extensible Hypertext Markup Language) is a specific form of XML, a markup language for web pages. XHTML contains all HTML 4.01 items and is mostly downward compatible, in other words, it can be viewed by browsers that are not XHTML compliant.