<xsl:if> - XSLT: Extensible Stylesheet Language Transformations 编辑
XSLT/XPath Reference: XSLT elements, EXSLT functions, XPath functions, XPath axes
The <xsl:if>
element contains a test attribute and a template. If the test evaluates to true, the template is processed. In this it is similar to an if statement in other languages. To achieve the functionality of an if-then-else statement, however, use the <xsl:choose>
element with one <xsl:when>
and one <xsl:otherwise>
children.
Syntax
<xsl:if test=EXPRESSION> TEMPLATE </xsl:if>
Required Attributes
test
- Contains an XPath expression that can be evaluated (using the rules defined for
boolean( )
if necessary) to a Boolean value. If the value is true, the template is processed; if it is not, no action is taken.
Optional Attributes
None.
Type
Instruction, appears within a template.
Defined
XSL section 9.1.
Gecko support
Supported
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论