PLEASE NOTE: All CMIT modules have now been withdrawn,
and are unavailable for the 2010/11 academic year
These web pages and lecture notes are left as reference for those students
requiring CMIT modules to complete their programme only, and are not an
indication of modules currently offered.
MIT3112/3212
Example Code Snippets and Assignments
Examples from the Notes
Module Outlines specified with DTD [XML, DTD, XSLT1 (result), XSLT2 (result)] or with XML Schema [XML, XSD]
A more detailed (but unfinished) module outline specification using XML Schema [XML, XSD, XSLT (result) ]. Illustrates the use of IDs and IDREFS to cross-reference elements within the documents, use of conditional tests within XPath expressions and simple use of <choose> to format lists.
A brief, unfinished example of TEI documentation for the module outline example, to illustrate links and program code markup in TEI form [TEI-XML (use 'view source'), PDF, HTML].
JokeBook [XML, DTD, XSL1, XSL2] and JokeBookXSD [XML, XSD]
Address Book [index] - a simple example of filtering and sorting.
Meeting Minutes [index] - an example of multiple data documents linked with a master file (note: it is also possible to use XIncludes to perform this task, though it is less well supported in many browsers & other software).
Some CSS-related Examples
Try these in different browsers to test CSS support, then view the xml source and look at the .css files to work out what they are supposed to look like!
CSS :first-child selector [css]
CSS :before and :after selectors [css]
CSS alternate stylesheets [css: default, large-print, summary - use Firefox 'View/Page Style' menu to select]
XQuery and TEI Examples
As part of a project to encode local history materials, here is an excerpt of "Smalltalk at Wreyland", the diary of a local man from Lustleigh, encoded as a TEI P5 XML document. You should be able to see how rich this markup language is for encoding literary and historical texts.
The encoding can be used to advantage when indexes or summaries are required; here is an XQuery to show the date values embedded in the text, in chronological order [XQL, result XML ]. Xquery can also be used to format results as XHTML [XQL, result XHTML].
A further example queries the text for all proper names that occur, and for each unique @key value (which shows the regularised forms), it gives all variants that occur in the main text [XQL, result XHTML].
Sample Applications from previous years
These should give you a guide to the level of complexity and detail required for the assignment. Note that the documentation now has to be written in DocBook or TEI, rather than XHTML.
eSSLC (rated excellent)
booklist (rated good)
Example Real-World Applications
The following are examples of document-centric applications of XML for data exchange in the real world - some are well developed, others are little more than proposals. They may give you some ideas on what to tackle for your project.
Text-based
- DocBook
- A general purpose DTD (currently being converted to Relax-NG Schemas), originally designed for technical documentation, but now very widely used for all types of books, articles and other documentation. There's a compact version (Simplified DocBook), advanced stylesheets for HTML and PDF output, and plenty of documentation freely available.
- Historical Event Markup Language (HEML)
- A schema to encode historical data tied to particular places and events. Stylesheets available, as are server-side Java interface routines, to provide searching and collation dynamically on the web. Also outputs graphical timelines and graphs using SVG graphics.
- Text Encoding Initiative (TEI)
-
An extremely complex document type designed to encode manuscripts, books, plays, etc., including variant texts and physical details of the originals. TEI was created to preserve and disseminate humanities texts, and has evolved into a highly adaptable system with user-configurable DTDs for encoding hybrid texts (See the Pizza Chef and Roma). There is also a simplified version (TEI-Lite/ TEI-XLite ) designed to handle the most common text types with an easy-to-learn tagset.
TEI can be used as a general-purpose document format - for example, Michael Sperberg-McQueen outlines a way of writing powerpoint-like slides using it on his website; Eric Lease Morgan details how he uses TEI for general web publishing
- NewsML, SportsML, etc.
- The IPTC (International Press Telecommunications Council) have generated a series of markup languages to encode events and news stories
- ParlML: A common vocabulary for parliamentary language
- A past call-for-discussion by the European Parliament, to create a flexible markup language for the multilingual texts produced by Europe. Though there's no actual document structures proposed yet, there's a lot of discussion about possibilities (well, this is the European Parliament ;-).
- ParlParse
- This is an effort to provide structure for publically available UK parliamentary data. The xml documents created are used in a number of websites, such as theyworkforyou.com.
