2010-08-07 198 views
0
<xsl:apply-templates 
    select="$tempPosterItemNodeSet/CurrentPosterItemCollection/PosterItem" 
    mode="PosterItem"> 

    <xsl:sort 
     select="$tempPosterItemNodeSet/CurrentPosterItemCollection/PosterItem/Property[@name='WidgetID']" 
     data-type="number"/> 

</xsl:apply-templates> 

我需要xslt排序我傳遞給我在上面的示例中的模板的節點集。XSL排序功能

任何人都可以告訴我如何排序上述xsl邏輯?

+0

XSL教程:http://www.w3schools.com/xsl/el_sort.asp – 2010-08-07 14:23:34

回答

1

我認爲這可能是工作:

<xsl:apply-templates 
    select="$tempPosterItemNodeSet/CurrentPosterItemCollection/PosterItem" 
    mode="PosterItem"> 

    <xsl:sort 
     select="Property[@name='WidgetID']" 
     data-type="number"/> 

</xsl:apply-templates> 

http://www.w3.org/TR/xslt#sorting

對於要處理的每個節點,所述 表達與該節點 爲當前節點並且與 完整評價正在處理的節點清單 以未排序的順序作爲當前節點的 清單。