An Introduction to XSLT and XPath
Creating The Stylesheet
Now that we have the course information marked up in XML, let's see how we can devise a stylesheet for displaying the
XML document nicely on a web browser.
Course Title:
Synopsis:
Duration: days
Fees: S$
Dates:
//
From hrs to hrs
@ -
|
To associate the stylesheet with the XML document, simply insert an additional PI at the top of the XML document:
Refreshing the XML document on IE5 will yield a nicely formatted document:
What IE 5 did was to load the specified stylesheet and transform the XML document into HTML. It is important to note that
the transformation takes place on the browser-side. This is known as client-side transformation.
Next: Dissecting The Stylesheet
|