Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Mar 24, 2011 @ 16:02
    Biagio Paruolo
    0

    xslt sorting: Is it possible to write to nested sorting?

    Is it possible to write to nested sorting?

    That is:

     <xsl:for-each select="$spotNodeSet">

         <xsl:sort select="rdm:Random(5)" order="descending" />

         <xsl:sort  select="(./newsDate [string(current()/newsDate)!=''] | ./@updateDate [string(current()/newsDate)=''])" order="descending"  />

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 24, 2011 @ 17:43
    Jan Skovgaard
    0

    Hi Biagio

    Do you get any errors from the above code? I'm not sure the expressions you're using in the select statement are correct/allowed in xsl:sort. But yes, you can have as many sort's as you would like. If it can not sort against the first xsl:sort it moves on the next etc.

    /Jan

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Mar 25, 2011 @ 23:01
    Biagio Paruolo
    0

    Hi,

    I've not error, but is it possibile to order first on first sort then the result order by second sort?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 26, 2011 @ 00:35
    Jan Skovgaard
    0

    Ehm so you want to make two different sorts on the same xml?

    /Jan

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Mar 26, 2011 @ 16:31
    Biagio Paruolo
    0

    Yes... I wish to pick up 5 random nodes. Then I wish sort them by date and time.

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 26, 2011 @ 18:24
    Jan Skovgaard
    0

    Hi Biagio

    Hmmm...ah ok...I see...but if the stuff that is shown is random..does it matter that it is sorted by date then? Does'nt that undermine the meaning of "random"? :-)

    I see what you mean but I don't know how it can be done. Maybe some other bright mind in here has the answer.

    /Jan

     

Please Sign in or register to post replies

Write your reply to:

Draft