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
12.42Mb 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

Red Thread Sisters (9781101591857) by Peacock, Carol Antoinette
Forever Bound by Samantha Chase, Noelle Adams
Deception Creek by Persun, Terry
Spheria by Cody Leet
Kindness for Weakness by Shawn Goodman
Light of the Diddicoy by Eamon Loingsigh