XML: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 8: Line 8:


* 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 metalange 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 of XML appplications.
* 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 metalange 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 of XML appplications.
See also: [[Editing XML tutorial]]


== History ==
== History ==

Revision as of 18:12, 22 February 2011

This page provides a short overview. See the XML category for all XML-related topics (many) or follow up links in this overview.

Definition

  • 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 metalange 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 of XML appplications.

See also: Editing XML tutorial

History

  • 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 mentionned.

The XML planet

One may look at XML from different angles. We shall discuss a few here:

XML for better Web contents

Look at the picture below. It shows the idea that web documents can be composed / altered by several components:

HTML vs. XML Web contents (DKS)

XML as the foundation for the future semantic Web

  • Essentially 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 (simple micro-formats). Then it was web 3. Then came the anti-semantic HTML 5 initiative. So in 2010 it's probably web 4 ....

XML for machine to machine talk

  • Several protocols for machine-to-machine interaction like SOAP and XML-RPC. See the web service article
  • Specialized search engines
  • Special formats like RSS or FOAF are meant to help organization of networked information spaces.
  • ...

XML as formalism to define "grammars"

  • This more formal view simply states that XML is currently the most popular standard to define various kinds of data structures. On could define three kinds:
  1. XML accessories (e.g. XML Schema)
    • Extend the capabilities specified in XML
    • Intended for wide, general use
  2. XML transducers (e.g. XSLT)
    • Convert XML input data into output
    • Associated with a processing model
  3. XML applications in the narrow sense (e.g XHTML)
    • Define grammars, constraints for a class of XML data
    • Intended for a specific application area as diverse as for example e-learning, banking, multimedia, translation,...

Some technical XML concepts

An XML document can refer to a physical file, a database entry, a datastream (any appropriate "text" that is delimited).

Wellformedness

An XML document is well formed if and only if

There is an appropriate XML declaration at the beginning
  • The document starts with an XML declaration that includes a version number (currently 1.0).
<?xml version="1.0"?>
This declaration can also contain encoding information. By default encoding isUTF-8):
<?xml version="1.0" encoding="ISO-8859-1"?>
XML documents are hierarchical, i.e. each element must be inside an other one (except the first one, the so-called root tag).
  • begin-tags and end-tags that match
  • No tags crossing like
  <i>...<b>...</i> .... </b> 
  • There must be single root
    • It can only appear once and can not be used within other elements
Other features
  • XML is case sensitive, "LI" is not "li" for example
  • "Empty" tags must be self closing, e.g.
<br />
  • Attribute values are quoted
<a href= " http://tecfa.unige.ch:8080/xml.html " >)
  • Special caracters: <, &, >," and '. Use instead (and that include URLs !):
 &lt; &amp; &gt; &aquot; '

Valid

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).

The most popular ones are in this order:

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

Simple DTD

Text-centric vs. data-centric XML

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.

XML Applications

Again, this is just a stub, a lot is missing ....

Accessories

Extend the power of XML

Transducers

Various style sheet and query languages

Metadata and semantic web

Graphics and multimedia

Contents

  • Docbook. Most popular standard for writing large documents.
  • DITA. A more flexible module-based approach to documents, originally made by IBM.

These document standards (as well others) can intervene all stages of the document production/delivery pipeline. XML in the documentation world appears as:

  • XHTML: HTML rewritten in XML
  • 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

Application development

  • 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.

XML in education

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

  • In addition, there are languages for selling education, to exchange student data, curricula data etc.

XML Software

(longer entries have their own page)

XML creation

XML databases

Validation

Off-line validation
  • 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.
  • xmlTester.jar. This tools is based on the Xerxes parser.
  • XML Nanny. XML Nanny is a Free Mac OS X developer tool that provides an Aqua interface for checking XHTML and XML documents for Well-Formedness and Validity either locally or across the network. (Tiger OS X 10.4) [sept 2005]
On-line validation

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).

On-line validation for specific XML applications
  • 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, ... )

Links

Overviews

Tutorials

(this sections needs to be expanded some day)

News

Lists of XML applications (schemas)

References

  • Elliotte Rusty Harold, (2004). XML in a Nutshell, O'Reilly, Abstract/TOC ISBN 0-596-00764-7 (Best buy according to DSchneider).