A gentle introduction to XML markup
</work> <work type='poem' date='1845'> <title>The Raven</title> <author>Edgar Allen Poe</author> </work> <work type='play' date='1601'> <title>Hamlet</title> <author>William Shakespeare</author> </work> </catalog>
Exercise - Checking XML syntax
In this exercise you will learn to identify syntactical errors in XML files.
Examine the following file. Circle all of it's syntactical errors, and write in the corrections.
<name>Oyster Soup</name> <author>Eric Lease Morgan</author> <copyright holder=Eric Lease Morgan>© 2003</copyright> <ingredients>
<list> <item>1 <item>1 <item>2 <item>2 <item>2 </list>
stalk of celery onion tablespoons of butter cups of oysters and their liquor cups of half & half
</ingredients> <process> <P>Begin by sauteing the celery and onions in butter until soft. Add oysters, oyster liquor, and cream. Heat until the oysters float. Serve in warm bowls.</p> <p><i>Yummy!</p></i> </process>
Check for one and only one root element. Is there a root element?
Check for quoted attribute values. Are the attributes quoted?
Check for invalid use of entities. There are two errors in the file.
Check for properly opened and closed element tags. Five elements are not closed.
Check for properly nested elements. Two elements are not nested correctly.
Check for case-sensitive element naming. One element is not correctly cased.