非常教程

Xslt & Xpath参考手册

XSLT元素 | XSLT Elements

xsl:choose

XSLT / XPath参考:XSLT元素, EXSLT函数,XPath函数,XPath轴

<xsl:choose>元素定义了多种替代方案中的一种选择。它在过程语言中就像一个switch语句。

语法

<xsl:choose>
    <xsl:when test="[whatever to test1]"></xsl:when>
    <xsl:when test="[whatever to test2]"></xsl:when>
    <xsl:otherwise></xsl:otherwise> [optional]
</xsl:choose>

必需的属性

None.

可选属性

None.

类型

指令,与模板一起出现。它包含一个或多个<xsl:when>元素,以及可选的最终<xsl:otherwise>元素。

Defined

XSLT, section 9.2.

Gecko 支持

Supported.

Xslt & Xpath

XSLT 是扩展样式表转换语言 的外语缩写,这是一种对 XML(标准通用标记语言的子集)文档进行转化的语言,XSLT 中的 T 代表英语中的“转换”(Transformation)。它是 XSL(eXtensible Stylesheet Language)规范的一部分

Xslt & Xpath目录

1.其他杂项 | Miscellaneous
2.XPath 轴 | XPath Axes
3.XSLT元素 | XSLT Elements
4.XPath 函数 | XPath Functions
5.XPath 教程
6.XPath 实例
7.XPath 运算符
8.XPath 轴(Axes)
9.XPath 语法
10.XPath 节点
11.XPath 简介
12.XPath、XQuery 以及 XSLT 函数
13.XPath 总结