<xsl:apply-templates
select="$tempPosterItemNodeSet/开发者_JAVA百科CurrentPosterItemCollection/PosterItem"
mode="PosterItem">
<xsl:sort
select="$tempPosterItemNodeSet/CurrentPosterItemCollection/PosterItem/Property[@name='WidgetID']"
data-type="number"/>
</xsl:apply-templates>
I need to xslt sort a nodeset that I am passing to a template in the sample I have put above.
Can anybody let me know How I can sort the above xsl logic ??
I think this could work:
<xsl:apply-templates
select="$tempPosterItemNodeSet/CurrentPosterItemCollection/PosterItem"
mode="PosterItem">
<xsl:sort
select="Property[@name='WidgetID']"
data-type="number"/>
</xsl:apply-templates>
From http://www.w3.org/TR/xslt#sorting
For each node to be processed, the expression is evaluated with that node as the current node and with the complete list of nodes being processed in unsorted order as the current node list.
精彩评论