XML - Extensible Data Format

This is a standard and universal data format. It allows to reuse a presentation for different data or use different presentations for same data.

XML, the eXtended Markup Language, is a successor for SGML. More general than html, it incorporate data inside tags themselves and has unlimited description capacities. The format of the display is independant, and given by another document, the XSLT. Rules to create tags are defined by another document, the DTD (Document Type Declaration) which describes the grammar of the tags.
XML is processed by most programming languages through the Document Object Model.

XHTML est a subset of XML dedicated to Web page with standard tags recognized by browsers.

XML features

Sample code

An invoice in XML.

<?xml version="1.0" ?>
<!- Invoice from Scriptol.com ->
<invoice>
  <order>000156</order> 
    <date timezone="Greenwhich">
    Jan 1, 2003 14:30:00      
    </date>
    <address> 
   <firstName>Sherlock</firstName>      
   <lastName>Holmes</lastName>      
   <street>5 Baker St.</street>
    <city>London</city>
    <state>England</state>
     <zip>75004</zip>
     </address>
     <amount> 270 </amount>
  </order>
</invoice> 

Names of tags are chosen for the readability of the document, their role depends entirely on tools that will access it.

You can access an XML document in different ways

Accessing data in XML document

Whether to access data or to change the document, or convert it into another format, several classes of tools are used.

Parsers

There are two types of parsers. A tree parser loads the whole XML document entirely in memory, and you can then access the contents through the Document Object Model, specifically with instructions such as getElementsByTagName.
An event-driven parser on the contrary, according to the SAX API, loads the content progressively and all the data are stored, or only those that are asked.

XQuery

XQuery is a language for XML database query, either from a file or a database with a tree structure similar to that of XML as Apache's XIndice. It allows to create an XML database and use it.

XSLT

An XSL language is made of transformation rules. XSLT converts an XML document into another format such as HTML and can be used to access data too.

Tools and documentation

Programming languages AspectJ - Basic - C - CIL - C++ - C++11 - C# - Dart - Eiffel - Go - Java - JavaScript - JavaFX Script - Pascal - PHP - Python - QML - Rexx - Ruby - Scala - Scriptol - Tcl - HTML - XML - XAML - XUL - SQL