A Programming Example
In this example, you'll read the data from an XML file using an XSL template. That template will be contained in a file separate from the HTML file used for display in the browser. When the template acts on the XML data, it will create HTML code that will be dynamically inserted into the HTML file. Therefore, your project will be constructed from three files: the XML data file, the XSL template file, and an HTML file that will be updated dynamically.
The XML File
Of course, you need some data to read, so use the data in Listing 12.1, which is the catalog database from Hour 10.
Listing 12.1 The Data to Be Read by the XSL Template File
1: <?xml version="1.0"?> 2: <Catalog> 3: 4: <Book> 5: <Title>Teach Yourself XML in 24 ... |
Get Sams Teach Yourself XML in 24 Hours 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.