XML: What, Why, When & How?
Notes from the Workshop
June 2003
The PowerPoint Slides:
For this class we used the Oxygen XML editor available at: http://www.oxygenxml.com
Other XML software is available at: http://www.xmlsoftware.com
Some sample files we used:
To use these, download them to a folder on your computer. Open them with Oxygen. If you
just want to see their contents without actually downloading them, you can click on them
and then choose Edit: Page View or Edit: Source View in your web browser.
-
hale.html - this is an html file that can be
read by a web browser. Try opening this file in an XML editor and check it for
well-formedness. You will find it is not well-formed. Now try to validate it against
one of the following XHTML DTDs. It's even worse.
- To see the contents of the files, click on the link. If
your browser does not display the contents (for example, Internet
Explorer may display an error message), choose Edit: Page View (Netscape)
or View:
Source (Internet Explorer). To save the files, choose File: Save As.
In the class we explored three types of documents: a party
invitation, a recipe, and a play (see PP slideshow for examples). We analyzed their structures in terms of creating a DTD. Here is a sample DTD drawn from the party invitation example:
- party.xml - the invitation. To see the raw contents, click on it and then choose Edit: Page View or View: Source.
- party.dtd - the DTD generated by Oxygen from the party.xml file. Note how it contains both elements and attributes.
- party.xsl - a simple XSLT stylesheet for transforming the party.xml file into a HTML file for display on the web.
The Text Encoding Initiative's DTD is used for creating humanities related documents
such as transcriptions of manuscripts, dictionaries, literature, etc. It is a flexible,
powerful, and quite large DTD. You can learn more about it at http://www.tei-c.org. At that site
you can create your own TEI DTD, or, if you would like to see a sample, see
-
tei-pizza.dtd
- a full TEI DTD created from the TEI Pizza Baker!
-
testtei.xml - a very simple file based on
the TEI. To see the raw contents, choose Edit: Page View or View: Source.
-
testtei.dtd - this is a DTD generated by
Oxygen from the simple testtei.xml file. That is, Oxygen read the elements in that
file and created a new DTD based on them. As I only used a
few of the hundreds of
possible TEI elements, this is a very small DTD!
-
testtei.xsl - an XSLT stylesheet for the
testtei.xml file. This stylesheet transforms the XML file to an HTML file so it can
be displayed on the web.
Questions? Comments? Hope
Greenberg. Created/updated: June 2003.