📄 apply.htm
字号:
<html>
<script language="JavaScript">
function transform(){
var transformResult = bandList.transformNode(xslStyleSheet.XMLDocument);
xmlValue.innerHTML = transformResult;
}</script>
<xml ID="bandList">
<Bands>
<Band>
<Name>Beatles</Name>
<NumberOfMembers>4</NumberOfMembers>
<HomeTown>Liverpool England</HomeTown>
<CDList>
<CD>
<Name>Yellow Submarine</Name>
</CD>
</CDList>
</Band>
<Band>
<Name>Citizen King</Name>
<NumberOfMembers>5</NumberOfMembers>
<HomeTown>Milwaukee, WI</HomeTown>
<CDList>
<CD>
<Name>Brown Paper Bag</Name>
</CD>
<CD>
<Name>Better Days</Name>
</CD>
</CDList>
</Band>
</Bands></xml>
<xml ID="xslStyleSheet">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<table border="1">
<thead><th>Band</th><th># of Members</th><th>Home
City</th><th>CD(s)</th></thead>
<xsl:apply-templates select="Bands" />
</table>
</xsl:template>
<xsl:template match="Bands">
<xsl:for-each select="Band" order-by=".">
<tr>
<xsl:apply-templates select="Name" />
<xsl:apply-templates select="NumberOfMembers" />
<xsl:apply-templates select="HomeTown" />
<xsl:apply-templates select="CDList" />
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template match="CDList">
<td><table>
<xsl:for-each select="CD">
<tr><td>
<xsl:apply-templates select="Name">
<xsl:template match="Name">
<td style="Font-Size:8pt"><xsl:value-of /></td>
</xsl:template>
</xsl:apply-templates>
</td></tr>
</xsl:for-each>
</table></td>
</xsl:template>
<xsl:template match="Name">
<td><xsl:apply-templates /></td>
</xsl:template>
<xsl:template match="NumberOfMembers">
<td><xsl:apply-templates /></td>
</xsl:template>
<xsl:template match="HomeTown">
<td><xsl:apply-templates /></td>
</xsl:template>
<xsl:template match="text()"><xsl:value-of /></xsl:template>
</xsl:stylesheet></xml>
<body onLoad="transform()">
<p align="center"><img src="cd.gif"></p>
<p align="center"><b>A List Of Bands That I Have Listened To
Recently</b></p>
<div ID="xmlValue" align="center"></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -