感谢this post我想出下面的模板: -扩展的Sharepoint XSL模板
<xsl:variable name="Doc">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@DocumentLink1"/>
</xsl:call-template>
</xsl:variable>
<a href="{substring-before($Doc,',')}">
<xsl:value-of select="substring-after($Doc,',')" />
</a>
此模板嵌套在一个unorderd列表和L1标签(见下文)。由于此代码在html页面中存在物理和视觉存在,因此我不希望将li标签和可能的ul标签添加到模板中。任何人都可以告诉我如何做到这一点?
<ul>
<li>
<xsl:variable name="Doc">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@DocumentLink1"/>
</xsl:call-template>
</xsl:variable>
<a href="{substring-before($Doc,',')}">
<xsl:value-of select="substring-after($Doc,',')"/>
</a>
</li>
<li>
<xsl:variable name="Doc">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@DocumentLink2"/>
</xsl:call-template>
</xsl:variable>
<a href="{substring-before($Doc,',')}">
<xsl:value-of select="substring-after($Doc,',')"/>
</a>
</li>
<li>
<xsl:variable name="Doc">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@DocumentLink3"/>
</xsl:call-template>
</xsl:variable>
<a href="{substring-before($Doc,',')}">
<xsl:value-of select="substring-after($Doc,',')"/>
</a>
</li>
我很困惑什么测试使用? – toomanyairmiles 2009-06-05 08:54:04