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

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

If there are several matching templates left, and they all have the same import precedence and priority, the XSLT processor can either choose the one that occurs last in declaration order or report an error. Import precedence and declaration order are described under

on page 359.

If there are no templates that match the selected node, the built-in template for the relevant node kind is used. Built-in templates are described under

on page 243.

The rules for determining the default priority for a pattern are given in Chapter 12, on page 686.

Although the default priorities are carefully chosen, they do not guarantee that a highly selective pattern will always have higher priority than a less selective pattern. For example, the patterns
section/para
and
section/para[1]
both have priority +0.5. Similarly, the patterns
attribute(*, xs:integer)
and
attribute(*, xs:decimal)
have the same priority, even though the nodes that match the first pattern are a subset of those that match the second. Choosing your own priorities is therefore a more reliable approach.

The mode Attribute

If the

element has no
mode
attribute, then it applies only to the default (unnamed) mode, and it will be invoked only in response to an

instruction that uses the default mode. An

instruction uses the default mode if it has no
mode
attribute, if its
mode
attribute has the value
#default
, or if its
mode
attribute has the value
#current
and the current mode is the default mode. The concept of the current mode is explained on page 238.

If the
mode
attribute is present and has the value
#all
, then the template is applicable to all modes.

Other books

TRUTH by Sherri Hayes
15 Years Later: Wasteland by Nick S. Thomas
Flesh 02 Skin by Kylie Scott
Deity by Theresa Danley
Huckleberry Hill by Jennifer Beckstrand
Relic by Renee Collins
Mosaic by Jo Bannister
Deviant by Adrian McKinty