中的.是什么意思?为什么不能就替换成为Name?谢谢!
是不是模板的名称必须和此模板中要处理的节点名称一致,如果是的话,那么如果我再一个模板中要处理多个节点怎么办?不懂!请指教!多谢!
我的xml文件:
<?xml version="1.0" encoding="GB2312"?>
<?xml:stylesheet type="text/xsl" href="resume.xsl"?>
<document>
<resume>
<name>王</name>
<sex>男</sex>
<birthday>1980.12</birthday>
<skill>VC、JAVA</skill>
</resume>
</document>
xsl文件:
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- 根模板 -->
<xsl:template match="/">
<html>
<head>
<title>个人简历</title>
</head>
<body>
<xsl:apply-templates select="document/resume"/>
</body>
</html>
</xsl:template>
<!-- 简历模板 -->
<xsl:template match="resume">
<table align="center" border="1">
<tbody>
<caption>个人简历</caption>
<tr>
<xsl:apply-templates select="name"></xsl:apply-templates>
</tr>
</tbody>
</table>
</xsl:template>
<!-- 姓名模板 -->
<xsl:template match="name">
<td>姓名</td>
<td>
<xsl:value-of select="."/>
</td>
</xsl:template>
</xsl:stylesheet>