XML Exercises

The files that are mentioned in the assignments below can all be found in this zipped folder.

  1. Draw a tree diagram for the poem "The Waste Land" by T.S. Eliot. You can find the full text version of this poem in the folder named "XML-exercises". The text was obtained from Project Gutenberg.
  2. Draw a tree diagram that represents the structure of the following text.
    Date: Sun, 06 Aug 2006 10:03:16 +0100
    From: Willard McCarty
    To: Humanist Discussion Group
    Subject: defining humanities computing
    
    Dear colleagues,
    
    The philosopher F. H. Bradley, in "Association and Thought", Mind 12.47 (1887): 354,
    arguing in a footnote with the editor of that journal about how to define "a psychical
    fact or event" in the empirical science of psychology, declares that
    
      A definition in psychology is for me a working definition. It is not
      expected to have more truth than is required for practice in its
      science; and if when pressed beyond it contradict itself, that is quite
      immaterial.  Giving his definition, he then observes,  We see here the
      impotence of empirical science to justify its principles theoretically.
      -- not because this or any other empirical science is inherently inferior,
      but because in his view metaphysics has no place in it. But what then justifies
      such a field is its results, which in the case of psychology is a better
      understanding of how and why humans do what they do, and not only or primarily
      why we shop for particular products or any other such thing to which psychology
      might be applied.
    
    If humanities computing is an empirical field -- I won't say "science" for obvious
    reasons -- then by analogy its justification cannot be how and why it is that, say,
    historians do better history as a result, but how and why scholarly enquiry is
    different -- better, perhaps, but certainly different -- across all the humanities
    (by which the historians' improved performance may be explained). Not a metaphysical
    but a pragmatic philosophy?
    
    Yours,
    Willard McCarty
  3. Draw a tree diagram that can represent the structure of the literature list for the MA Book Studies.
  4. Open the XML file "literatureList.xml" in Oxygen. First, decide whether or not the document is well-formed. If the file is ill-formed, correct the errors that are reported by the XML editor.
  5. Draw a tree diagram that represents the stucture of "literatureList.xml".
  6. Open the file "literatureList.dtd". Is the XML file "literatureList.xml" valid? If not, what needs to be changed in the file to make it a valid XML document?
  7. Open "attributes.xml". All the titles of the works of art that are mentioned have been marked as such using the <title> element. Change the document in such a way that it becomes possible to distinguish the titles on the basis of their genre as well. Check the validity of your modified file with "attributes.dtd".
  8. Open the XML file "entities.xml". Is the file valid? As you can see, the document contains several non-ASCII-characters. Replace these with XML entities. A list of commonly used Unicode Character codes can be found on (for instance) Wikipedia.