XML Exercises
The files that are mentioned in the assignments below can all be found in a zipped folder named "XML.zip". If you have done the HTML exercises for DMT, you have probably downloaded this folder already.
Exercise 1.
Draw a tree diagram that represents the structure of the following text.
|
Exercise 2.
Draw a tree diagram that represents the structure of the following text.
The Tyger BY WILLIAM BLAKE Tyger Tyger, burning bright, In the forests of the night; What immortal hand or eye, Could frame thy fearful symmetry? In what distant deeps or skies. Burnt the fire of thine eyes? On what wings dare he aspire? What the hand, dare seize the fire? And what shoulder, & what art, Could twist the sinews of thy heart? And when thy heart began to beat. What dread hand? & what dread feet? What the hammer? what the chain, In what furnace was thy brain? What the anvil? what dread grasp. Dare its deadly terrors clasp? When the stars threw down their spears And water'd heaven with their tears: Did he smile his work to see? Did he who made the Lamb make thee? Tyger Tyger burning bright, In the forests of the night: What immortal hand or eye, Dare frame thy fearful symmetry? |
Exercise 3
Open the XML file "literatureList.xml". First, decide whether the document is well-formed. If the file is ill-formed, correct the errors that are reported by the XML editor.
Exercise 4
On a sheet of paper, draw a tree diagram that represents the stucture of "literatureList.xml".
Exercise 5
Connect the XML file "literatureList.xml" to the schema named "literatureList.rng" by removing the comment tags on line 2 (i.e. the following character sequences: "<!--" and "-->"). Is the document valid? If not, edit the file and make sure that it complies with all the rules in the schema.
Exercise 6
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 (e.g. plays, paintings, novels, poems etc.).
Exercise 7
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, or with Unicode Character codes.