2009-06-03 120 views
0

感谢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> 

回答

1

我从你的链接到你在这里使用内容查询Web部件其他职位假设。

您需要使用XSLT页眉/页脚技术将您的调用包装到此变量中。 Here is one我看过的几篇帖子说明了如何用CQWP来完成这个工作。

0

您可以尝试使用xsl:if元素来有条件地输出内容。你可以找到更多的信息,如何xsl:如果工程@http://www.w3schools.com/xsl/xsl_if.asp或只是使用你最喜欢的搜索引擎。

+0

我很困惑什么测试使用? – toomanyairmiles 2009-06-05 08:54:04