Introduction

XSLT is a declarative language. A stylesheet consists of a static set of instructions. Yet XSLT includes some instructions that will be familiar to software developers. If–then and choose–from features are included in all popular programming languages. Here, they are not used to control the flow of processing but to select optional portions of a template.

An 'if' statement isolates part of a template and only allows its content to become part of the template provided that some condition is met. A 'choose' statement is similar, but is more sophisticated. It is more efficient when the template output depends on a characteristic that has a wide number of options. It also allows a default value to be activated when none of the explicit ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.