This appendix contains some suggested solutions to the exercise questions posed at the end of most of the chapters throughout the book.
This chapter gave an overview of XML and why it's so useful.
<name> XML document you've been working with to include the person's title (Mr., Ms., Dr., and so on).
Because of the self-describing nature of XML, the only difficult part of adding a title to the
<name> example is deciding what to call it. If you call it
<title>, you can add it to your document as follows:
<name> <title>Mr.</title> <first>John</first> <middle>Fitzgerald Johansen</middle> <last>Doe</last> </name>
Another possibility is to treat a title as a simple prefix to the name; this also allows you the flexibility of adding a suffix. This approach might look like the following:
<name> <prefix>Mr.</prefix> <first>John</first> <middle>Fitzgerald Johansen</middle> <last>Doe</last> <suffix>the 3rd</suffix> </name>
In this case, instead of giving the data an explicit label, you're making it more generic and allowing some text to come before and after the name.
<name> example we've been using so far has been in English, but XML is language-agnostic, so you can create XML documents in any language you wish. Create a new French document type to represent a name. You can use the following table for the names of the XML elements:
Although this might ...