我不知道你打算怎么处理
<xsl:when test="sc:path(preceding)">
这读起来像是“喂那些叫
<preceding>
作为设置为的节点
sc:path()
功能”。
查看您的输入,没有具有该名称的子元素。
你的意思是这样的吗
<xsl:when test="sc:path(preceding-sibling::item[1])">
?
我对Sitecore一无所知,我会尝试一下:
<xsl:for-each select="exsl:node-set($processedResult)/item">
<xsl:sort select="
substring-before(
substring-after(sc:path(.), '/sitecore/media library/'),
'.aspx'
)"
data-type="text"
order="ascending"
/>
<xsl:variable name="path" select="
search:GetFriendlyPath(
'/sitecore/media library/', sc:path(.)
)
" />
<xsl:variable name="lastPath">
<xsl:choose>
<xsl:when test="preceding-sibling::item[1]">
<xsl:value-of select="
search:GetFriendlyPath(
'sitecore/media library', sc:path(preceding-sibling::item[1])
)"
/>
</xsl:when>
<xsl:otherwise>
<xsl:text>none</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- grouping test -->
<xsl:if test="$path != $lastPath">
<li>
<strong>
<xsl:text>in </xsl:text>
<xsl:value-of select="$path" />
</strong>
</li>
</xsl:if>
<li>
<!-- render detail -->
</li>
</xsl:for-each>