Parse/Pretty-Print example  (Canonicalise.hs)
--------------------------
To demonstrate parsing and pretty-printing, I wrote a simple in-out
application:
    $ hmake Canonicalise -I../lib
Test it on some XML documents:
    $ ./Canonicalise album.xml
You will notice that it changes some parts of the document, for instance in
    $ ./Canonicalise subjdb.xml
all parameter entities are replaced with their expansion.


Xml2Haskell example  (album.dtd, AlbumDTD.hs, album.xml)
-------------------
In this example, I did the following:

Convert the XML DTD for an album into a Haskell module:
    $ DtdToHaskell album.dtd AlbumDtd.hs

Edit the generated file (just to change the module name to match!)
    $ vi AlbumDtd.hs

Wrote the test application (App.hs) using AlbumDTD.hs, and compiled it:
    $ hmake App -I../lib

Running the test displays some progress messages, and outputs the original
document again, only with the album title changed.
    $ ./App album.xml new.xml

And that's it.


Haskell2Xml example  (Types.hs, DTypes.hs, Example.hs, subjdb.xml)
-------------------
The file Types.hs defines some data types for a mini-database.
Derive the Haskell2Xml apparatus using DrIFT:
    $ DrIFT Types.hs >DTypes.hs

The example program in Example.hs just writes some Haskell data to
an XML file.
    $ hmake Example -I../lib
    $ ./Example
    $ less subjdb.xml

I hope that's reasonably clear.


Bigger DtdToHaskell example
---------------------------
In directory SMIL, do
    $ DtdToHaskell SMIL20.dtd DTD_SMIL20.hs
and have a look at the resulting Haskell file.  This is a large
multi-part DTD for the Synchronised Multimedia Integration Language,
defined by the W3C.  As of 2000-11-16, our XML parser has been extended
to deal with the external subset as fully as possible.

