XML
From Halbeeg, the open encyclopedia · Af-Soomaali
79 languages
XML (Extensible Markup Language) is a markup language—a system for writing structured text using tags to separate data. Its purpose is to store information in a form that humans can read and programs can interpret directly. XML itself does not define tag names; the user defines them, which is why it is called 'extensible' or expandable.
XML was published by the W3C (World Wide Web Consortium), the organization that sets web standards. It derives from SGML, an earlier and much more complex markup language; XML is a simplified version. Its first specification was published around the late 1990s.
Structure
An XML document consists of elements that begin with an opening tag like <name> and end with a closing tag like </name>. Each element can have attributes written in the opening tag. Elements nest within each other, forming a tree structure: there is one root element from which the others descend. Comments and a prologue indicating the character encoding (such as UTF-8) can also be used.
Well-formedness and validity
Two levels of correctness are distinguished for XML documents. The first, 'well-formed', means that the general rules of XML syntax are followed: every tag is closed, the tree has a single root, and special characters are properly escaped. The second, 'valid', means that the document conforms to a schema defined beforehand, such as DTD or XML Schema (XSD), which specifies which elements are permitted and their order. The parser—the program that reads XML—performs this checking.
Related technologies
XML has several tools built on it: XPath for finding parts of a document tree, XSLT for transforming an XML document into another form such as HTML, and XQuery for asking more complex questions of it. Namespaces resolve conflicts when two systems use elements with the same name.
Use and competition
XML is used for application configuration files, exchanging data between different systems, and document formats such as RSS and SVG. In recent years, JSON has replaced it in many areas, especially in web APIs, because it uses fewer characters and integrates more easily with JavaScript. XML remains in use, however, where strict schema validation and lengthy documentation are required.