XML Introductory Tutorial

Many XML tools are available in the labs, the best is XMLSpy but don't forget EditPlus, Firefox, Chrome and even IE.

1.   Download books-css.xml and its associated stylesheet, books.css.

View your books-css.xml in a browser. It should look something like:

screenshot of browser displaying books.xml rendered with books.css

Use "view source" to look at the underlying XML.

Edit books.xml to comment out the line that links to the stylesheet. Reload the document it should now look something like:

screenshot of Firefox displaying books.xml in XML display mode

2.   Using EditPlus (other editors are available) experiment with changing books.xml to make the document not well-formed in various ways. Try to get your browser to display at least three different error messages.

3.   Open books.xml in XMLSpy and experiment with editing it. Try adding another book.

4.   Download books.dtd. This is a DTD for the document books.xml. Edit books.xml to link it to the DTD by adding the following line:

<!DOCTYPE booklist SYSTEM "books.dtd">

Change books.xml so that it is still well-formed but is no longer valid according to the DTD (e.g. remove one of the <title> elements). Check to see if Firefox, Chrome, IE or XMLSpy validate the document against its DTD when you view it.

5.   Try the W3Schools XML tutorial



© k.mcmanus 2015
Valid XHTML 1.1! . Valid CSS . WCAG priority 3 approved