How is XML used?

XML is a mark-up language used to provide a standard format for information, allowing for easier storage, transmission, access and display of data by applications.

Specification

XML is a web technology, developed by the W3C and the XML specification, currently version 5.0 is available to see here: https://www.w3.org/TR/xml/)

Legacy uses

XML can be used to separate content from design. This separation means that transforming the look and feel of a huge website can be achieved quickly and easily, by comparison with sites where content and design are integrated. Web content can be served to different devices, with different screen sizes, in a user-friendly way, using different stylesheets and templates, with the same XML data. In this way the same content and data can be stored once and repurposed and viewed in different ways without unnecessary duplication. This has been largely replaced with CSS and HTML5, but you may still come across XML in use in this way.

Image Credit

Current uses

XML is still widely used to exchange data between computer applications. XML supports nesting of data, which can be very useful when sending data that includes subsets of information. XML uses a schema, which allows for validation of received data in a way that the alternative format JSON does not. XML is order dependent, so is great for sending and receiving data that has to be structured in a very specific order, but is more verbose than JSON. XXE (XML external entities) is a security vulnerability which needs careful avoidance by programmers. XML is used to create configuration files, particularly in Java environments.


Image Credit

Conversion

You may find you need to quickly extract information or data from one format, and convert it into XML or another format. Information is often sent from one part of a business to another in PDF documents. PDF is a great format for ensuring accurate display across devices, and easy to read in browsers or to send via email. It can be hard to extract data from PDF documents for analysis. To easily transform data from PDF to Excel spreadsheet format, or to XML, companies such as https://pdftables.com/ offer a fast online service which can be a real time saver.

In summary, if you are sending data between applications which needs to be structured in a specific way, and may contain nested fields of information, consider using XML.