This is next in a series of related posts on Fun Tech Stuff going under the hood with XML and its uses in learning technologies: Learning Management Systems, SCORM, Tin Can, Metadata, and XML, as well as examples of XML in SCORM and XML in eBooks.
XML is the workhorse of metadata and the semantic Web, the means by which we describe the meaning and context of information on the Web. XML stands for eXtensible Markup Language. It pops up all over the place, specifying contents and navigation in elearning, in ebooks, and on the Web.
XML is a markup language much like HTML (HyperText Markup Language), the language we use to display the words, pictures, sounds, and video that make up the Web.
What is a markup language? It is a system of rules and hidden tags (i.e., labels) that let us define how data can be stored, displayed, or processed. It is quite powerful but quite simple in structure. It’s based on plain text and designed to be readable by both humans and machines.
Here’s a simple example of HTML markup.
Let’s say you want your Web page to display a heading and a few short paragraphs. You want it to say this:
So you would mark it up as follows, using angle brackets (< >) and tags to tell the browser how you’d like the text displayed:
<p>Being a hopeless optimist, I think the Chicago White Sox are going to win the World Series this year! People may laugh, but I have hope. </p>
<p>That is the meaning of being an optimist. </p>
As you can see, this is not rocket science! The <H1> tag indicates where the heading should start, and the </H1> indicates where the heading should end. Likewise, the <p> and </p> tags indicate where the paragraphs should start and end.
The basic scheme is as follows:
< / end tag>
Of course there are lots of tags, and lots of complexity in how those tags can be used and nested, but the underlying scheme is straightforward.
HTML and XML
HTML and XML are similar in nature, both being markup languages, but they have a couple of key differences.
First, HTML is designed to tell Web browsers how to display data; it’s all about marking up text and other assets like images, sound, and video, so the browser knows how to format it: make it a heading, make it bold, put it in a table, turn it into bullet points, make it so tall or so wide, break a paragraph, skip a line. Second, the tags you use to mark up your words and pictures are all predefined; you have to use the right tags if you want to get the right result. If you said:
the browser wouldn’t know what you were talking about, and would not display your heading correctly. HTML is an open standard. And while it is constantly evolving, it is well known to both Web developers and browser developers, so generally what we code is rendered properly.
XML, on the other hand, is not designed to display data, it’s designed to provide meaning and context for data, so the markup is used to do that.
Meaning and Context
In our previous Metadata post, we gave an example of a person using a Web site that contains a monument’s latitude and longitude so that person can locate the monument while walking through a park. The latitude and longitude would be defined in the Web site with XML tags that might look something like this:
<geo:long> -87.62382 </geo:long>
XML provides meaning and context for data, and provides it using plain text, so it can be easily written and read by any application (as well as by people).
Also, XML tags are not predefined; you or an outside organization can define the meaning of the tag and link to its definition. The meaning and context of the data is conveyed both by the tag itself and by the linked definition of the tag, called an XML Name Space (xmlns).
< … xmlns:geo=”http://www.w3.org/ …>
Tags define the data, and name spaces define the tags:
Of course the point is not to learn how to code XML, but to understand its power, and how it is used under the hood in Web sites, in e-learning delivery (e.g., SCORM), and in ebooks, all of which are key to the future of learning.
In the next two posts, we’ll look at a couple of examples of how XML is used, first in SCORM, and then in an ebook, to create the metadata that describe the meaning and context of that information.