<?xml:stylesheet type="text/xsl" href="resume.xsl"?>
然后建立一个新文件:resume.xsl,其内容如下:
程序代码:
<?xml version="1.0" encoding="gb2312"?>
<html xmlns:xsl="http://www.w3.org/tr/wd-xsl">
<head>
<title>个人简历</title>
</head><body>
<xsl:for-each select="resume">
<p/>
<table border="1" cellspacing="0">
<caption style="font-size: 150%; font-weight: bold">
个人简历
</caption>
<tr>
<th>姓名</th><td><xsl:value-of select="name"/></td>
<th>性别</th><td><xsl:value-of select="sex"/></td>
<th>生日</th><td><xsl:value-of select="birthday"/></td>
</tr>
<tr>
<th>技能</th><td colspan="5"><xsl:value-of select="skill"/></td>
</tr>
</table>
</xsl:for-each>
</body>
</html>
<html xmlns:xsl="http://www.w3.org/tr/wd-xsl">
<head>
<title>个人简历</title>
</head><body>
<xsl:for-each select="resume">
<p/>
<table border="1" cellspacing="0">
<caption style="font-size: 150%; font-weight: bold">
个人简历
</caption>
<tr>
<th>姓名</th><td><xsl:value-of select="name"/></td>
<th>性别</th><td><xsl:value-of select="sex"/></td>
<th>生日</th><td><xsl:value-of select="birthday"/></td>
</tr>
<tr>
<th>技能</th><td colspan="5"><xsl:value-of select="skill"/></td>
</tr>
</table>
</xsl:for-each>
</body>
</html>