[an error occurred while processing this directive] Why XML?

Why XML?

A cautionary tale in three parts.

The Hand-written Note

Being friendly with my local neighbourhood general store, I was in the habit of sending brief notes to Joe, the owner of the store. See Figure 1.

Joe,

Please send over the following: half a dozen cans of 7 Up, 2
copies of 19 magazine, Harpers & Queen, and the latest
Harry Potter.

Thanks,

Mick


Figure 1 : My Note

He would often come himself, but occasionally sent one of his staff. Joe understood what I wanted because I was a regular customer and he knew what was in his store. Of course I didn't want two copies of "19 magazine" and two copies of "Harpers" and two copies of "Queen"! He also knew which Harry Potter book was "the latest".

The Invoice

As the store grew larger, our relationship became more formal. It was necessary to send an order to the store manager, who was still Joe. See Figure 2.

To: Joe Smith
Corner Supermarket
Any Street
London
Quantity Item
6 Can of 7 Up drink
2 19 magazine
1 Harpers & Queen magazine
1 Harry Potter and the Goblet of Fire
From: Mick Farmer
School of Computer Science
Birkbeck, University of London
Malet Street
London

Figure 2 : My Order

Getting better. The in-store operative could collect the items for delivery from the shelves, but did I want the Harry Potter audio tape or the hardback book? It also looks as if delivery is to the University of London in Malet Street. Joe was out of the loop.

The XML

Eventually our organisations started communicating automatically over the Internet. See Figure 3.

<?xml version="1.0"?>
<!-- Created by VendOMat on 19/03/2001 -->
<!DOCTYPE order SYSTEM "note.dtd">

<order ref="123">
  <to id="joe"/>
  <from id="mick"/>
  <item quantity="6">
    <drink size="250ml" type="can">
      7 Up
    </drink>
  </item>
  <item quantity="2">
    <magazine title="19"/>
  </item>
  <item quantity="1">
    <magazine issn="0141-1144"/>
  </item>
  <item quantity="1">
    <book isbn="074754624X"/>
  </item>
</order>


Figure 3 : My XML

Nirvana! My order is dispatched automatically, choosing between my weekly and monthly choices depending on the date. Invoices and payments are handled automatically by our computer systems because they understand one another. Databases are queried for details of suppliers, consumers, and goods. While idle, Joe's system orders more goods and processes more invoices, my system runs dnetc!