XML – what is it? Simply explained

by Johannes

If you are wondering what XML is, we have the right answer for you. In this practical tip we will show you what you need XML for, how to use it and where you will encounter it.

XML – a versatile mark-up language

XML stands for eXtensible Markup Language and arose out of the necessity that HTML had reached its limits.

  • XML is a data format. XML is a text-based data format, similar to “JavaScript Object Notation”, better known as JSON.
  • This means that XML data can be opened and edited in an editor. In addition, computers can read and write the XML format.
  • XML, like HTML, consists of so-called tags that are placed between angle brackets ‘<‘ ‘>’.
  • In contrast to XML, there is only one fixed set of tags in HTML, such as
  • With XML you can define your own tags. Only what a tag must look like is defined, but not what it means.
  • An XML tag can stand alone as follows: Alternatively, a tag can also enclose a range. Then there is an opening and a closing tag: Area
  • Tags can be nested within each other. In this way, a hierarchy can be created
  • If necessary, a tag can have one or more parameters. The syntax for this is as follows:
  • Parameters always consist of a name and a value. The value is enclosed in double inverted commas and assigned with an equal sign.
  • An example of a data structure in XML is shown in the picture.

 

Use of XML

XML can be used in many ways. What you can do with XML and what advantages and disadvantages XML has, you can read here.

  • Basically, XML can be used to describe, store and exchange data.
  • The main advantages of XML are that it is widely used and requires little learning. In addition, XML can be easily interpreted by humans and machines.
  • The only disadvantage of XML is the data overhead compared to a binary format. This means that a structure stored in XML format requires more memory than is strictly necessary. Accordingly, it can also be processed somewhat more slowly.
  • XML is often used to import and export application data. For example, a customer database can be well represented in XML format. By nesting tags, you can assign multiple attributes to a customer. A field for the phone number can additionally store in a parameter whether the number is a mobile or private number.
  • One way of storing data via XML for customer management is shown in the picture.

The first word “eXtensible” already indicates that the language is extensible. Today, you probably use XML every day in technologies such as HTML or RSS.

Related Articles

Leave a Comment