X hits on this document

548 views

0 shares

1 downloads

0 comments

18 / 142

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.

1.

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>&copy; 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>

  • A.

    Check for one and only one root element. Is there a root element?

  • B.

    Check for quoted attribute values. Are the attributes quoted?

  • C.

    Check for invalid use of entities. There are two errors in the file.

  • D.

    Check for properly opened and closed element tags. Five elements are not closed.

  • E.

    Check for properly nested elements. Two elements are not nested correctly.

  • F.

    Check for case-sensitive element naming. One element is not correctly cased.

10

Document info
Document views548
Page views554
Page last viewedFri Jan 20 00:04:29 UTC 2017
Pages142
Paragraphs3126
Words34660

Comments