The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Extensible Markup Language (XML) is a structured document format that defines human- and machine-readable encoding rules.

Extensible Markup Language

Wikipedia defines XML as follows:

XML (Extensible Markup Language) is a set of rules for encoding documents in both human-readable and machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards.

In short, XML is:

  • Designed to transport and store data.
  • A flexible text format derived from SGML (ISO 8879).

The design goals of XML emphasize simplicity, generality, and usability over the Internet. It is a textual data format with strong support via Unicode for the languages of the world. Although the design of XML focuses on documents, it is widely used for the representation of arbitrary data structures, such as in web services. XML is also used heavily in Android application development, providing administration and design layout for an app.

Many Application Programming Interfaces (API's) have been developed to aid software developers with processing XML data, and several schema systems exist to aid in the definition of XML-based languages.

Example Document

The following text is defined using XHTML and entity references; the text serves as an example of XML syntax and structure:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
  <!ENTITY hello "Hello, World!">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>&hello;</title>
  </head>
  <body>
    <div>&hello;</div>
  </body>
</html>

Resources

The following links provide additional information for learning about XML:

history | excerpt history

Code Language (used for syntax highlighting): lang-xml