Exercises

  1. 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.
  2. Add similar XML markup for title, story, moral, paras and quotes to The Peacock and the Crane (peacock.txt)
  3. Choose some of the following to express in well-formed XML
    1. an email [sample]
    2. a supermarket till receipt
    3. a restaurant takeaway menu [sample]
    4. a retail catalogue (e.g. IKEA, Next, Argos)
    5. a TV listings magazine [sample]
  4. 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).
  5. Suggest some alternatives for your structuring decisions in (3), noting the pros and cons of elements and attributes.