Exercises
- Fix the errors in The Fox and the Goat (fox-bad.xml)
with a text editor so that you can view it successfully in Firefox or Internet Explorer.
- Add similar XML markup for title, story, moral, paras and quotes to The
Peacock and the Crane (peacock.txt)
- Choose some of the following to express in well-formed XML
- an email [sample]
- a supermarket till receipt
- a restaurant takeaway menu [sample]
- a retail catalogue (e.g. IKEA, Next, Argos)
- a TV listings magazine [sample]
- Think about the decisions you made in (3) about which pieces of
information you chose to represent in the XML file and which you left out. Can
you use the information for lots of different purposes? Which pieces of
information are artefacts of the object you chose (e.g. the page numbers in
the catalogue or the supermarket logo on the receipt).
- Suggest some alternatives for your structuring decisions in (3), noting
the pros and cons of elements and attributes.