再问:在xsl里可以通过为同一个Topic建立多种模板吗?
之前的问题:
http://expert.csdn.net/Expert/topic/2361/2361674.xml?temp=.9865991
现在不管mode用什么,item它都自动地套用<xsl:template match="item" mode="Whatever">
<div id="xmldata">
<xsl:apply-templates select="Topic/item" mode="only"/>-->
</div>
<div id="Layer1" name="Layer1">
<xsl:apply-templates select="Topic"/>
</div>
<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" mode="Whatever"/>
</table>
</xsl:template>
<xsl:template match="item" mode="only">
<xsl:element name="item">
<xsl:element name="author">
<xsl:attribute name="xh"><xsl:value-of select="author/@xh"/></xsl:attribute>
<xsl:value-of select="author" />
</xsl:element>
<xsl:element name="title">
<xsl:value-of select="title" />
</xsl:element>
<xsl:element name="time">
<xsl:value-of select="time" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="item" mode="Whatever">
<tr align="center">
<td><xsl:value-of select="author/@xh"/></td>
<td>
<xsl:value-of select="author"/>
</td>
<td><xsl:value-of select="title"/></td>
<td><SPAN STYLE="font-style:italic"><xsl:value-of select="time"/></SPAN></td>
</tr>
</xsl:template>
请求继续帮助!