In the above file, the xsl:for-each element locates elements
in the XML document and repeats a template for each one. The select
attribute describes the element in the source document. The syntax for this
attribute is called an XSL Pattern, and works like navigating a file
system where a forward slash (/) selects subdirectories. The xsl:value-of
element selects a child in the hierarchy and inserts the content of that child
into the template.
Since an XSL style sheet is an XML file itself, the file begins with an xml
declaration. The xsl:stylesheet element indicates that this
document is a style sheet. The template has also been wrapped with xsl:template
match="/" to indicate that this is a template that corresponds
to the root (/) of the XML source document.
If you add a reference to the above stylesheet to your original XML document
(look at
line 2), your browser will nicely transform your XML document into HTML (open it in
IE5):