<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
<xsl:for-each select="catalog/cd">
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
尝试一下 »
点击 "尝试一下" 按钮,查看它是如何工作的。
W3C建议中所有XSLT元素的描述,以及有关浏览器支持的信息。
XSLT、XPath 和 XQuery 函数
XSLT2.0、XPath2.0和XQuery 1.0共享相同的函数库。有超过100个内置函数。有用于字符串值、数值、日期和时间比较、节点和QName操作、序列操作等的函数。
❮ 上一节
下一节 ❯