Sign In/My Account | View Cart  
advertisement

Article:
 Sorting in XSLT
Subject: Custom built xsl:sort
Date: 2005-09-06 18:49:53
From: srinivasvemuri

Hi,


How do i proceed if i were to sort say using Time Period, where my values are Early Bronze, A.D.,BYZANTINE, IRON I. i.e., Sorting with domain knowledge!!!


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Custom built xsl:sort
    2005-09-06 19:23:45 Bob DuCharme

    XSLT sorts alphabetically or numerically. It would be an interesting exercise to map your values to alphanumeric key values and trying to sort by those, though.

    • Custom built xsl:sort
      2005-09-07 12:22:45 srinivasvemuri

      Thanks for the suggestion. Could you explain in detail. I have a different xml file that maps each time period to an integer.
      ex. period.xml --->
      <entry period="middlebronze">1</entry>
      <entry period="byzantine">2</entry>
      <entry period="Roman">3</entry>
      <entry period="islamic">4</entry>


      How do above file in xslt sort based on time period? I am trying something like this!!!!
      <xsl:for-each select="timeperiod">
      <xsl:sort select='key(?,?)' />
      </xsl:for-each>


      • Custom built xsl:sort
        2005-09-07 14:02:01 Bob DuCharme

        I haven't followed through on this myself, and doing so and then providing a detailed explanation will take more time than I have available right now. I suggest you try the XSL-list at http://www.mulberrytech.com/xsl/xsl-list/.


Sponsored By: