The File Format

First, let’s look at the file format that I designed. A topic file with one response appears in Listing 14.1. You’ll see the custom tags I created for this file format.

Listing 14.1. The Topic File Format for the Web Discussion Application
 1: <topic> 
 2: <title>Sample Topic</title> 
 3: <author>Rafe Colburn</author> 
 4: <lastmodified>1024805727</lastmodified> 
 5: <post> 
 6: Just some information you might find interesting.</post> 
 7: <responses> 
 8: <response> 
 9: <responseauthor>John Doe</responseauthor> 
10: <responsepost>Yes, that was interesting.</responsepost> 
11: </response> 
12: </responses> 
13: </topic> 

Let’s look at the tags (or elements, as they’re called in the XML world) that appear in the file. These tags aren’t HTML tags, ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition 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.