XSLT TutorialLesson 60Free preview
XSLT <choose>
This lesson is part of XML · All levels
Summary
It provides if-else branching within XSLT 1.0. It contains one or more <xsl:when> with test attributes, as well as an optional one <xsl:otherwise> as a branch if all false. This syntax is similar to switch-cases in programming languages.
Key points
- <xsl:choose> is the container; the actual decision is in <xsl:when test="...">
- There could be many, and the first true- is used.
- Optional, maximum one, placed at the end
- When all when and there is no otherwise, there is no output
- Suitable for classification such as price category or grade value
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.