This article or chapter is incomplete and its contents need further attention.
Some information may be missing or may be wrong, spelling and grammar may have to be improved, use your judgment!
This article provides a short and rather non-technical overview of XML. See also the XML category for all XML-related topics (many) or follow up links in this overview.
Learning goals
Understand the role of XML in IT
Be able to identify major roles and XML languages made for the Web
Prerequisites
none
Next steps
Tour de XML or equivalent (having seen some real world applications would be good for motivation)
XML means "Extended markup language". XML is a formalism that allows to define all sorts of languages that describe a wide range of "information contents" (e.g. web pages, vector graphics, programming languages). In technical terms, such languages are called XML applications or XML vocabularies.
XML is designed as a machine readable self describing text editable persistent store for data, but it can be read (somewhat) by humans. XML is a formalism or a meta-language. Such a metalanguage is not to be confounded with HTML, a language to describe the structure of Web pages. XHTML, for example, is one out of the thousands existing XML applications.
XML is a subset of the Standardized Generalized Markup Language (SGML). SGML has been used to define HTML, whereas XHTML is defined with XML (This is why empty tags are not allowed anymore in XHTML). HTML5 on the other hand, is neither based on SMGL nor on XML.
Since then, hundreds of XML languages have been defined and a few dozen are popular and in production. Ken Sall's famous Big Picture only lists some, e.g. none of the many IMS e-learning standards are mentioned.
Currently, there are hundreds of more or less popular XML languages. Within the more narrow area of web standards there are less and we shall shortly introduce the most important ones that non-programmers like content developers or web designers should know about
Initially, XML was thought to redefine the way contents are delivered. After that, it turned out that XHTML was (almost) never used as XML, e.g. in the form HTML combined with other XML contents. This "XML" vision of HTML still exists in the mind of some people, but the death of XHTML 2 put a provisional end to this. The current mainstream, represented by HTML5, is a computer application-centered model, i.e. HTML is seen as a delivery platform for interactive contents and not as a document format.
The picture below shows the idea that web documents could be composed of several components: In the case of HTML, there is HTML + CSS, in the case of HTML5 there is HTML + built-in SVG and MATHML + plus CSS. In the case of XHTML 1 or XHTML 5 a document can include any other XML language, provided that these are identified by so-called namespaces. Although it is not longer popular, we also included SGML in the picture, since it is the "mother" of all tag-based markup languages.
HTML vs. XML Web contents ... made many years ago (DKS)
Just to make sure: The death of XHTML does by no means mean that XML is not being used on the Internet. It's just dead as web page format. Other formats like SVG (vector graphics), MathML (mathematical formula), RSS (content syndication) are very much in use today and will be so in the future.
XML as the foundation for the future semantic Web[edit | edit source]
The semantic web is essentially defined by the RDF framework. While RDF itself is used in some areas (e.g. Metadata formalisms), the global semantic web project seems to be somewhat stalled, except for occasional flares. Web 2.0 was supposed to be semantic but web 2.0 became all the opposite, i.e. it is based on simple micro-formats. Then it became web 3. Then the anti-semantic HTML 5 initiative became dominant and the "semantic web" remains a "smaller island" of interest and applications.
Topic Maps (ISO standard) used to organize collections of resources in the form of semantic network (so you do not find just the trees, but there is a "map" of the forest.
RDF is a language used for describing relationships between objects and it can be used for adding "metadata" describing the content of a resource.
OWL ("Web Ontology Language", created with RDF), is a formalism that allows the description of the relationships between things. There is a conceptual link with Syndication of news and the social web
During the last 15 years internet has been the subject of a profound change regarding the organization of its "information spaces".
In a more general perspective, XML is currently one of the most popular standards to define various kinds of data structures. One could define three kinds:
Define grammars, constraints for a class of XML data
Intended for a specific application area as diverse as for example word processors, e-learning, banking, multimedia, translation. Well know examples are Microsoft Office contents (e.g. .docx files) or Adobe Flash *.fla files. These files are in fact zip files composed of a series of XML documents. Unzip on of these and you can see.
An XML document can refer to a physical file, a database entry, a datastream. In other words, technically speaking an XML document is any sort of delimited "text" defined as a string and that has XML markup inside.
An XML document is said valid if it conforms to some kind of grammar also called schema. An XML grammar formally describes an XML application (or vocabulary or language).
XML applications in addition to DTDs may include other constraints. Some XML applications may include languages that are not XML-based (e.g. CSS or XPath).
The most popular grammars are DTDs. Below we just include a picture of a little grammar (read the details in DTD tutorial
Data-centric XML as opposed to the text-centric XML refers to XML whose primary audience is not a human reader, but a computer program which will process the information, respond to it, store data items in a database, and so on.
These document standards (as well others) can intervene all stages of the document production/delivery pipeline. XML in the documentation world appears as:
MXML is an XML-based user interface markup language used in Adobe Flex, a software development kit to create Flash-based Internet and desk-top applications.
XML User Interface Language (XUL) is the XML user interface markup language developed by the Mozilla project. It operates in cross-platform applications such as Firefox.
Any XML document can directly be put on the web together with a CSS stylesheet or an XSLT transformation. Specialized formats like SVG (vector graphics), X3D (3d vector graphics), MathML (formulas) can be added to XML-compatible browsers. Larger documents are often produces with specialized vocabularies such as DITA or DocBook. Contents can be written either with an XML editor or an XML-aware word processor. Such documents can then be either directly "saved as" or sent through various cusom output filters.
XML document production pipelines
Presenting XML documents with style sheets[edit | edit source]
Today one can directly display information encoded in XML (of any grammar) in a browser, by using a style-sheet.
The style-sheets allow to:
Prepare / arrange content for a "presentation".
Define the “layout” (format, formatting) of a text written in Xml.
Alter contents, e.g. by adding a table of contents or page headers
The utility of style-sheets is therefore
Separation of content and presentation
Simplification of work (one style-sheet for many documents, single source publishing, etc.)
XSL - The Extensible Stylesheet Language[edit | edit source]
CSS also can be used for style XML contents. However since its transformation capabilities are rather poor, the XML already should include all the data to be published.
Xlink allows inserting a link in XML document, where a link expresses a relationship between two or more objects. XLink remains a proposal, there’s no complete implementation for the moment. However, subsets of Xlink are used in various other XML languages.
On has to make a distinction between languages specifically developped for the education section (see below) and all the rest of XML technology, most of which can be useful to education
Most decent XML editors do offer validation functionality. However, some free XML editors do not. Some (like Xemacs) only offer limited verification.
xmllint, a command line tool which is distributed as part of the libxml2 C parser developed for the Gnome project. This means that it ships with most Linux installations, but there also distributions for Windows and other OSs.
Note: You may need to change DTD's or Schema's local system identifier. These programs must be able to get the DTD. I rather suggest installing a local program on your machine (like xmllint or xmlTester).
W3C HTML Validation Service This validator doesn't work with your own DTD's. Its primary function is to validate W3C vocabularies (HTML, XHTML, SVG, MathML, ... )