<xsl:if>
<xsl:if> 元素包含一个 `test` 属性和一个模板。如果 `test` 的计算结果为 true,则处理该模板。在这方面,它与其他语言中的 if 语句类似。但是,要实现 if-then-else 语句的功能,请使用 <xsl:choose> 元素,其中包含一个 <xsl:when> 和一个 <xsl:otherwise> 子元素。
<xsl:if> 元素包含一个 `test` 属性和一个模板。如果 `test` 的计算结果为 true,则处理该模板。在这方面,它与其他语言中的 if 语句类似。但是,要实现 if-then-else 语句的功能,请使用 <xsl:choose> 元素,其中包含一个 <xsl:when> 和一个 <xsl:otherwise> 子元素。