我有一个 for each 循环新闻项目节点。在其他属性中,这些新闻项目有两个属性用于创建日期。系统添加日期和用户输入的创建日期(以覆盖系统日期)。我希望该列表按创建日期排序,并带有用户输入日期的首选项。
以下是我卑微的无效尝试!
<xsl:for-each select="$currentPage/ancestor-or-self::node /node [@nodeTypeAlias = $documentTypeAlias and string(data [@alias='umbracoNaviHide']) != '1']">
<xsl:choose>
<xsl:when test="data [@alias = 'createdDate'] != ''">
<xsl:variable name="sort" select="string(data [@alias = 'createdDate'])"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="sort" select="string(@createDate)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:sort select="$sort" order="descending"/>
非常感谢