gpt4 book ai didi

xslt - XSLT 中的节点排序

转载 作者:行者123 更新时间:2023-12-01 09:10:35 25 4
gpt4 key购买 nike

此代码选择节点,我要处理...:

<xsl:variable name="rootTextpageNode" 
select="$currentPage/ancestor-or-self::node [@level = 2 and
@nodeTypeAlias = 'CWS_Textpage']" />

如何在其中放置排序/排序依据,以便首先显示 createdDate 较新的项目?

我正在使用 CWS 入门工具包,需要更改 SubNavi.xslt 中显示的项目顺序

最佳答案

您可以在 for-each 之后的第一行中进行排序,如下所示:

<xsl:for-each select="$rootTextpageNode">
<xsl:sort select="@createDate" order="descending" />
<xsl:value-of select="@nodeName" />
</xsl:for-each>

关于xslt - XSLT 中的节点排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1417679/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com