开发者

XSL sort functionality

开发者 https://www.devze.com 2023-01-10 10:43 出处:网络
<xsl:apply-templates select=\"$tempPosterItemNodeSet/开发者_JAVA百科CurrentPosterItemCollection/PosterItem\"
<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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号