The application spectrum
XML is useful both for human beings and computers. Common scenarios in which XML can be used by people include:
- writing a book using DocBook. Docbook is an XML application designed for the markup of new texts. It is especially common in
computer documentation. Much of the Linux Documentation Project corpus is
written in DocBook. The advantages of using DocBook include: it is nonproprietary, portable, modular, and easy to use with any text editor. Moreover, you may format the final version according to your needs: PostScript to print, DVI to view, HTML for publish on the web;
- writing a web page in XHTML. XHTML defines an XML-compatible version of HTML. Unlike HTML documents, a valid XHTML document can be manipulated with the same tools you use to work with XML. Moreover, the XHTML document may contain other markup belonging to a different XML application, like an SVG picture or a MathML equation.
The advantages of using XHTML include: it has a well-defined syntax, you can work with any XML tool (to parse, validate, link, and query your document) and web search engines eventually will
understand your document and properly index it.
The resulting documents are called text-centric documents.
These are XML documents usually written by humans for other humans to read. They are
semipermanent XML documents with a lot of text and a poor structure.
Common scenarios in which XML can be used by computers include:
- data exchange. Information comes in different sources
(relations, objects, documents) and it needs to be exchanged between these
sources. XML might act as the common dataspeak;
-
semistructured databases. Semistructured data has no
regular schema. It often includes duplicated and missing information. Hence, it
does not naturally fit into relational databases. XML has been proposed as the
data model for semistructured data.
The resulting documents are called data-centric documents.
These are XML documents usually written by computers for other computers to read. They
are transitory XML documents with a rich structure and a lot of raw data.