The xsl:if Element
All programming languages contain a construct to test for an item that can be only either true or false. If the value is true, a section of code is executed. If it's false, the first section is skipped, and another section may or may not be executed. In JavaScript, the construct is an if-else statement. The else part is optional. If your goal is to execute a segment of code when the value is true and do nothing otherwise, the else is not included.
In XSL, you can use the xsl:if command to construct an expression that will control the conditional execution of a block of XSL code. The delimiters of the block of code are the opening and closing <xsl:if> tags. There's no companion xsl:else command, although it can be mimicked ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access