Processing Database Records

In our example, the product data came from a static file written by a human being. Sometimes, XML will be generated on the fly from the contents of a database or the results of an algorithm. The result of a database query will be either a single database row, as shown in Listing 6.11, or a list of records (perhaps the results of a search), as shown in Listing 6.12.

Listing 6.11. A Database Record in XML
<?xml version=”1.0” ?> 
<person> 
  <name>Alaric B. Snell</name> 
  <email>alaric@alaric-snell.com</email> 
  <url>http://www.alaric-snell.com/</url> 
</person> 
Listing 6.12. A Database Query Result in XML
 <?xml version=”1.0” ?> <results> <person> <name>Alaric B. Snell</name> <email>alaric@alaric-snell.com</email> <url>http://www.alaric-snell.com/</url> ...

Get Special Edition Using XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.