XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Structure controls processing / Default-template rules

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)

We have just seen that source-tree nodes are processed even when the stylesheet has no template rule for them. This is because the XSLT processor has its own rules for these cases, called Default template rules. They do not actually exist in the form listed below; their behavior (Note: it would be equally appropriate to speak of default behavior for particular node types rather than default template rules) can nevertheless be modeled by suitable rules.

Every node type has a default rule. Whenever an explicit rule exists for a node, it takes precedence over the default. This is called priority (precedence): a default rule has the lowest possible priority.

Consequently, any default rule is overridden even by an equally general explicit rule. For example, the default rule for comments can be replaced by one that processes comments instead of ignoring them.

   

back to top