tended to be formatted and presented in a readable format. Or it can be a convenient form for packaging data records for transmission from one place to another, or simply for storage, in a portable format. The following is an example of text that can be for- matted for display: <paragraph> The purpose of this type of XML document is to use <italic>tags</italic> in such a way that the software that reads the document will be able to <underline>organize</underline> and <underline>format</underline> the text in such a way that it is more presentable and easier to read. </paragraph> This form of XML looks a lot like HTML. In fact, this form of XML and HTML both serve exactly the same purpose: to allow the software reading the document to extract things from it and also to use the tags as formatting instructions to create a display from the extracted text. The same basic form can be used to package data, as in the following example: <person> <name>Karan Dirsham</name> <street>8080 Holly Lane</street> <city>Anchor Point</city> <state>Alaska</state> <zip>99603</zip> </person> This second form is more like a collection of fields that go to make up a data record, and used this way, it can be a very convenient method for storing data and transmitting in- formation among otherwise incompatible systems. All that is necessary for successful data reception of transmitted data is for the recipient to understand the meanings of the tags and be able to extract the data from them. Of course, by using the appropriate ap- plication to read and process the data, any XML document can be easily formatted for display. The process of extraction and formatting XML data is the primary subject of this book. Attributes can be used to specify options that further refine the meaning of the tags to the process reading the document. These attributes can be used both for data defin- ition and for formatting. For example, the following code has attributes: <person font="Courier"> <name type="first" enhance="bold">Janie</name> <name type="last" enhance="underline">Rorick</name> </person> Any program reading this document can apply its own interpretation to the mean- ings of the tags and the options. No formatting information is included in an XML doc- ument. All formatting is left entirely to the process reading and interpreting the XML document. One program could read a document containing this example and take the 4 Chapter 1 3851 P-01  1/28/02  10:32 AM  Page 4