XML

XML is a markup language used for storing and transporting structured data in a format that is both human-readable and machine-readable.

XML (Extensible Markup Language) is a markup language designed to store and transport data. While HTML is used to display data, XML is used to describe it. It provides a flexible way to create common information formats and share both the format and the data on the World Wide Web, intranets, and elsewhere using standard ASCII text.

The language is based on a hierarchical tree structure. Each XML document starts with a root element that branches out into child elements. To maintain data consistency, XML utilizes XSD (XML Schema Definition) or DTD files, which define the rules, constraints, and data types allowed within the document.

How it works

XML is the backbone of various technologies, including SOAP for web services and RSS for content syndication. It is extensively used in configuration management (e.g., pom.xml in Java projects) and for defining UI layouts in mobile development. Its ability to represent complex nested structures makes it ideal for data-heavy enterprise applications.

  • Supports Unicode for global compatibility.
  • Provides strict data validation via schemas.
  • Uses Namespaces to prevent element name conflicts when merging documents.

A typical XML fragment: <customer id="5"><name>John Doe</name></customer>. Although more verbose than JSON, XML is preferred in scenarios requiring formal data contracts and complex metadata representation.