문제

이 코드는 노드를 선택하고 작업하고 싶습니다 ... :

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

SORT/ORDERBY를 거기에 넣으려면 최신 생성 된 데이트가있는 항목이 먼저 표시됩니까?

CWS 스타터 키트를 사용하고 있으며 subnavi.xslt에 표시된 항목 순서를 변경해야합니다.

도움이 되었습니까?

해결책

다음과 같이 첫 번째 줄에서 첫 줄에서 정렬을 할 수 있습니다.

<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>

보다 XSLT 정렬 그리고 정렬 정보를 넣을 위치

마크

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top