Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
There's a great deal of clutter in this rule. The code outputs a table row (a For each The first cell contains an optional hyperlink anchor and a sequence number. The call on In the second cell, the template calls After producing these three cells, the template calls: This selects the immediately following sibling element, provided it is an As I mentioned before, I would normally write the predicate as
element) and the first three cells in that table (
elements).
element, there is a six-line
diff
attribute on this or some ancestor element, and the coloring happens only if the stylesheet parameter
$show.diff.markup
is enabled. This clutter could be reduced dramatically by replacing the six lines with a call such as the following, to return the relevant attribute node when required, or an empty sequence otherwise:
level=“any”
is a good example of how to generate a sequence of numbers that runs through the document. It creates a sequential number for each
to process the contents of the
::=
that separates the term from its definition. In various places it inserts nonbreaking space characters (
) to achieve visual separation between the parts of the rule.
[self::rhs]
rather than
[name()=‘rhs']
to avoid namespace problems, and more particularly, to allow the optimizer to use indexes if it can.Other books