疑惑:在xsl里可以通过为同一个Topic建立多种模板吗?
我现在用jsp生成了一个xml文件:xml.jsp
其运行结果为:
<?xml version="1.0" encoding="gb2312" ?>
<?xml-stylesheet type="text/xsl" href="Style.xsl" ?>
<Topic>
<item>
<author xh="2">dddd</author>
<title>fsd</title>
<time>03/09/17</time>
</item>
<item>
<author xh="3">ffff</author>
<title>注意注意注意注意注意</title>
<time>03/09/17</time>
</item>
</Topic>
在Style.xsl中用<xsl:template match="Topic">建立了一个Topic的模板,接着后来的程序我又想再次为Topic建立一个不同的模板,请问可以吗?不想用<xsl:for-each>,谢谢
<xsl:template match="Topic">
<table width="500" border="1" align="center" cellpadding="1" cellspacing="1" bordercolordark="#ffffff" bordercolorlight="#ADAAAD">
<tr bgcolor="#FFCC99" align="center">
<td style="cursor:hand" onClick="taxis('blue_ID')">编号</td>
<td style="cursor:hand" onClick="taxis('blue_name')">作者</td>
<td style="cursor:hand" onClick="taxis('blue_text')">主题</td>
<td style="cursor:hand" onClick="taxis('blue_time')">发表时间</td>
</tr>
<xsl:apply-templates select="item" />
</table>
</xsl:template>