CHAPTER 6 INTRODUCTION TO XSLT 175 The first line of this code block tells the XSLT processor to match the
element. The transformation applies to everything between the opening and closing tags. The stylesheet achieves this with the
element, which specifies a template for the transformation. The next four lines show what to insert at the start of the template, before the contents from the original element. The stylesheet adds a paragraph with two links. The template doesn t transform the tag itself, so you have to include this tag at the start of the template. The transformation changes the starting tag to
Visit NASA! | Tour the solar system
This transformation includes a header with two links. Applying the Transformation The following line actually applies the transformation to the
element: This line says, Work through all of the contents of the element and perform any other transformations you need to on any tags you find. In this case, you don t want to transform the rest of the element. Rather, you want it to pass through unchanged. You ll see how this happens shortly. Adding the Footer The last lines in this code block add the footer after the unchanged element:
Copyright Planetary Fun 2006. This creates a horizontal rule followed by the words Copyright Planetary Fun 2006. Unfortunately, because you re outputting to HTML 4.0, the
tag transforms to
. You end by closing the
element to tell the XSLT processor that you ve finished working with the element. Transformation Without Change When the stylesheet applies the transformation, you want the remaining document contents to remain unchanged, including the , , ,