The Format of a Stylesheet
Listing 5.1 shows a simple XSL stylesheet. Let's examine it and break it down line by line before moving on to examine each of the features of XSL.
Code Listing 5.1. catalog-simple.xsl—A Simple Stylesheet
1: <?xml version="1.0"?> 2: <!-- 3: A simple style sheet for placing a header and footer on any document. 4: Al Saganich for Macmillan USA 5: --> 6: 7: <!-- Use the transform version 1.0 namespace -- > 8:<xsl:stylesheet 9:xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" 10: indent-result="no" default-space="strip"> 11:<!-- <xsl:output method="text"> --> 12: <!-- 13: Format for transforms are match rule followed by action. 14: This transform matches the root element 15: Prints [header] followed by a cr-lf pair 16: 17: ... |
Get XML Development with Java™ 2 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.