XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (269 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
11.68Mb size Format: txt, pdf, ePub

The option
tunnel=“yes”
allows the parameter to be set up as a tunnel parameter. Tunnel parameters are described in the entry for

on page 429, with a worked example on page 433.

Usage and Examples

Parameters to templates take on considerable significance in XSLT because variables cannot be updated. This means that many tasks that in conventional programming languages are done by updating variables in a loop are done instead in XSLT using recursive calls and parameters. The consequences of this are explained in Chapter 17, and there are some detailed examples of the technique in Chapters 19 and 20.

Examples of recursive calls are also included in this chapter under

on page 274.

See Also


on page 237


on page 240


on page 271


on page 425

Summary

This was a long chapter, but I hope you agree that every page was worth it! We have examined all of the XSLT elements in detail and have provided working examples to bolster your understanding of how they are used.

Many of the XSLT instructions described in this chapter contain embedded XPath expressions to compute their input. The next four chapters present a detailed description of the syntax and semantics of XPath expressions.

Chapter 7

XPath Fundamentals

This chapter defines some fundamental features of the XPath language. The first half of the chapter describes the basic syntactic and lexical conventions of the language, and the second half describes the important notion of context: this establishes the way in which XPath expressions interact with the environment in which they are used, which for our purposes primarily means the containing XSLT stylesheet.

The complete grammar of the language is summarized in Appendix A, and for convenience I have split the constructs of the language across five chapters, as follows:

Chapter
Scope
7
Notation used for describing the grammar
Overall structure of the language
Lexical rules (including comments and whitespace handling)
Literals
Variable references
Parenthesized subexpressions
Context item expression
.
Function calls
Conditional expressions:
if
8
Arithmetic operators:
+
,
-
, …
Value comparison operators:
eq
,
lt
, …
General comparison operators:
=
,
<
, …

Other books

Love Me: Oakville Series:Book 5 by Kathy-Jo Reinhart
The Fighter by Jean Jacques Greif
In the Dark by Marliss Melton
Unusual Uses for Olive Oil by Alexander McCall Smith
One Night with a Hero by Laura Kaye
Like It Never Happened by Emily Adrian
Ashes to Ashes by Barbara Nadel