【发布时间】:2011-02-11 07:49:36
【问题描述】:
我有一个内容查询 Web 部件 (CQWP) 从新闻链接列表中提取 URL 和标题。 CQWP 使用 ItemStyle.xsl 中定义的 XSLT 样式 Orange.News.Links。
我需要按照下面注释的方式对标题@Title0 字段进行排序,因为它会导致错误。
有谁知道是什么导致了这个错误? - 非常感谢。 XSLT 代码如下:
<xsl:template name="Orange.News.Links" match="Row[@Style='Orange.News.Links']" mode="itemstyle">
<xsl:param name="CurPos" />
<xsl:param name="Last" />
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@URL"/>
<xsl:with-param name="UrlColumnName" select="'URL'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="LinkTarget">
<xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
</xsl:variable>
<xsl:variable name="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="Header">
<xsl:if test="$CurPos = 1">
<![CDATA[<ul class="list_Links">]]>
</xsl:if>
</xsl:variable>
<xsl:variable name="Footer">
<xsl:if test="$Last = $CurPos">
<![CDATA[</ul>]]>
</xsl:if>
</xsl:variable>
<xsl:value-of select="$Header" disable-output-escaping="yes" />
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="substring-before($DisplayTitle,', ')"></xsl:value-of>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@Description"/>
</xsl:attribute>
<!-- <xsl:sort select="@Title0"/> -->
<xsl:value-of select="@Title0">
</xsl:value-of>
</a>
</li>
<xsl:value-of select="$Footer" disable-output-escaping="yes" />
</xsl:template>
【问题讨论】:
标签: sharepoint xslt sharepoint-2007 web-parts