numbers_english.xslt

来自「基于java的xsl与xml程序例子」· XSLT 代码 · 共 45 行

XSLT
45
字号
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" encoding="UTF-8"/>
	
	<xsl:variable name="lang.pageTitle">XSLT in English</xsl:variable>
	<xsl:variable name="lang.tableCaption">
		Here is a table of numbers:
	</xsl:variable>
	<xsl:variable name="lang.englishHeading">English</xsl:variable>
	
	<xsl:template match="/">
		<html>
			<head>
				<title><xsl:value-of select="$lang.pageTitle"/></title>
			</head>
			<body>
				<xsl:apply-templates select="numbers"/>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="numbers">
		<h1><xsl:value-of select="$lang.pageTitle"/></h1>
		<xsl:value-of select="$lang.tableCaption"/>
		<table border="1">
			<tr>
				<th><xsl:value-of select="$lang.englishHeading"/></th>
				<th>
					<xsl:value-of select="language"/>
				</th>
			</tr>
			<xsl:apply-templates select="number"/>
		</table>
	</xsl:template>
	<xsl:template match="number">
		<tr>
			<td>
				<xsl:value-of select="@english"/>
			</td>
			<td>
				<xsl:value-of select="."/>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?