Glossary

XML

TL;DR

XML (eXtensible Markup Language) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable, commonly used for data storage and transport.


Concept

XML (eXtensible Markup Language) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. Designed to store and transport data, XML is a foundational technology in web services, configuration files, and data exchange between disparate systems.

Key characteristics of XML include:

  1. Self-Descriptive: XML documents contain both data and metadata about the structure of that data through tags.

  2. Hierarchical Structure: XML organizes data in a tree-like structure with parent-child relationships between elements.

  3. Extensible: Users can define their own tags and document structure, making it adaptable to various data representation needs.

  4. Platform-Independent: XML is a text-based format that can be processed by any system that supports text processing.

  5. Validation: XML documents can be validated against schemas (DTD, XSD) to ensure they conform to a specific structure.

Basic XML syntax:

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <element attribute="value">Content</element>
  <list>
    <item>Item 1</item>
    <item>Item 2</item>
  </list>
</root>

XML components:

  • Elements: Defined by tags (e.g., ) that can contain other elements or text
  • Attributes: Name-value pairs within element tags (e.g., )
  • Text Content: Data contained within elements
  • Comments: Explanatory text using syntax
  • Processing Instructions: Instructions for applications using syntax

XML is commonly used for:

  • Web services (SOAP messages)
  • Configuration files
  • Data exchange between different systems
  • Document storage and publishing
  • RSS feeds
  • Sitemaps

While XML was once the dominant format for data exchange on the web, it has largely been supplanted by JSON for web APIs due to JSON’s simpler syntax and better integration with JavaScript. However, XML remains important in enterprise systems, configuration management, and specific domains where its validation and extensibility features are valuable.

Related words: YAML