質問
このコードはノードを選択します。作業を行います...:
<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>
他のヒント
この変数の割り当てにソートを追加できるかどうかはわかりません-通常、テンプレートを適用するとき、またはforeachを実行するときにソートします:
<xsl:template match="employees">
<xsl:apply-templates>
<xsl:sort select="salary"/>
</xsl:apply-templates>
</xsl:template>
または
<xsl:for-each select="catalog/cd">
<xsl:sort select="artist"/>
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
マーク
所属していません StackOverflow