Carving Your Rosetta Stone

In the late eighteenth century archeologists had a problem. They found a lot of tablets written in a script, Egyptian hieroglyphs, they couldn't decipher. It was only after French soldiers in Napoleon's army unearthed a large stone tablet in 1799 that archaeologists were able to make a breakthrough in deciphering the script. On the stone was written a decree, inscribed in Egyptian hieroglyphics, Greek, and demotic characters (the basis of a later Egyptian script). English and French archeologists eventually were able to “crack” the code of Egyptian hieroglyphs through their knowledge of Greek, vastly enlarging the amount of material that fifth-grade social studies teachers have to teach.

The XML application designer's equivalent to a Rosetta stone is the XML DTD. A DTD, or document type definition, describes how your individual XML instances are constructed. A DTD describes which XML elements are allowed, their attributes, and how they fit together to form a valid piece of XML.

Figure 5-1. The Rosetta Stone


Elements and Attributes

When structuring data, we first separate it into two classes: elements and attributes of elements. These terms have several different meanings, depending on the context. Each has a specific definition within the XML and the SQL lexicons. For the purposes of this book, I mostly use the XML meanings of elements and attributes. As the following illustrates (from an XML example taken from Chapter 1), the element is the book, while the attribute is the ISBN)




..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset