Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • miken 21 posts 71 karma points
    Apr 01, 2013 @ 19:04
    miken
    0

    about the "sort order"

    Hi experts,

     

    I used "<xsl:sort select="@sortOrder" order="descending" />" in my xslt, but I got a weird problem.

    I have 14 child nodes under "Content", and sort them from 0-13, but it showed in website as

    9,8,7,6,5,4,3,2,13,12,11,10,1,0

     

    How to fix this?

    Thanks

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 01, 2013 @ 19:07
    Tom Fulton
    100

    Hi,

    I think maybe its doing a string based sort by default.  Try adding the data-type attribute like so:

    <xsl:sort select="@sortOrder" order="descending" data-type="number" />

    -Tom

Please Sign in or register to post replies

Write your reply to:

Draft