Original article: JanEgilRefsnes translation: A Jie qi. XSL control statement 1. Conditional statement if... thenXSL also has conditional statements (haha ~~ It's amazing, like programming languages ). The specific syntax is to add an xsl: if element, like this xsl: ifmatch = .[
Original: Jan Egil Refsnes
VII. XSL control statements
1. Conditional statement if... then
XSL also has conditional statements (haha ~~ It's amazing, like programming languages ). The specific syntax is to add an xsl: if element, similar to this
... Some output...
The preceding example is rewritten as follows:
2. Choose of XSL
The use of choose is to present multiple conditions and give different display results. The specific syntax is to add a set of xsl: choose, xsl: when, xsl: otherwise elements:
... Some code...
... Some code ....
The preceding example is rewritten as follows: