take care over writing your question, it's much more likely that someone will take care over answering it.
3. Show a complete source document, a complete example of your required output, and if you want to know why your code doesn't work, your complete code—but only after paring the problem down to its essentials. Don't ask people to debug code that they can't see.
4. If you tried something and it didn't work, say exactly what you tried and exactly how it failed (including details of what products you are using).
For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.
List of Examples
This list includes all the worked examples in the book: that is, the examples consisting of entire stylesheets, for which working code can be downloaded from http://www.wrox.com/ . It does not include the many examples that are provided as incomplete snippets.
The purpose of this list is to help you out when you know that you've seen an example somewhere that is relevant to your current problem, but you can't remember where you saw it.
Chapter 1
Description
Page
A Hello World Stylesheet
This stylesheet creates an HTML containing a greeting (such as “Hello, World!”) read from the source XML document.
11
Tabulating Word Frequencies
Given any XML document, this stylesheet produces a list of the words that appear in its text, giving the number of times each word appears, together with its frequency. This illustrates features in XSLT 2.0 for analyzing text using regular expressions, and for grouping based on common values.
19
Displaying a Poem
This stylesheet shows how to use template rules to render the text of a poem in HTML.
35
Chapter 2
Description
Page
An XML Tree
This example shows how an XML document is represented as a tree in the data model.
46
Push Processing
This stylesheet shows the use of template rules to display a list of books in HTML, using one template rule for each different kind of node.
74
Controlling the Sequence of Processing
This example shows a refinement of the previous stylesheet in which the select attribute of is used to control the sequence of different parts of the output.
77
Selecting Nodes Explicitly
This shows a further refinement of the book list stylesheet in which some aspects of the output are generated using instructions.
77
Chapter 3
Description
Page
Using
This example shows the use of to split a stylesheet into three modules performing distinct tasks: one to format the current date, one to construct a copyright statement, and one to control the rest of the processing.
91
Using
This stylesheet extends the previous example, showing how allows some of the declarations in one module to be overridden in the importing module.
95
Embedded Stylesheets
This example shows the use of a stylesheet embedded within the source document that it is designed to display.
102
A Simplified Stylesheet
This is an example of a simplified stylesheet module, that is, a stylesheet whose outermost element is a literal result element rather than an element.
125
Using An Extension Instruction
This stylesheet uses Saxon's element to illustrate how a stylesheet can call extension instructions provided by a vendor or third party.
139
Chapter 4
Description
Page
Validating the Source Document
In this example a stylesheet takes advantage of the fact that the source document can be validated against a schema before the transformation starts.
67
Validating the Result Document
This stylesheet invokes validation of the result document using the option of the instruction.
71
Chapter 6
Description
Page
Using Modes
The example uses a mode to display a