The test pattern statements supported by XSLT are used for conditional judgment, mainly:
<xsl:if> <xsl:choose> and its under <xsl:when> and <xsl:otherwise>
Or the user list data source that is used in match mode.
1: Use Xsl:if
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<body>
<table border="1">
<tr bgcolor="#9acd32">
<th>Name</th>
<th>ID</th>
</tr>
<xsl:for-each select="Users/User">
<xsl:sort data-type="number" select="@ID" order="descending" />
<xsl:if test="ID mod 2=1">
<tr>
<td><xsl:value-of select="Name"/></td>
<td><xsl:value-of select="ID"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</xsl:template></xsl:stylesheet>
About the operators used by test:
= or $eq$ equal
= or $ieq$ equality (case-insensitive)
!= or $ne$ Range
$ine $ unequal (case-insensitive)
< or $lt$ less than
$ilt $ less than (case insensitive)
<= or $le$ less than or equal
$ile $ less than or equal (case insensitive)
> or $gt$ greater than
$igt $ greater than (case-insensitive)
>= or $ge$ is greater than or equal to
$ige $ greater than or equal (case-insensitive)
$all $ collection operator that returns true if all items in the collection meet the criteria
$any $ collection operator that returns true if any item in the collection satisfies a condition
| Collection operator, which returns a union of two sets