[xsl] Troubleshooting a sort

Subject: [xsl] Troubleshooting a sort
From: "Grant, Kathryn --- Sr. Technical Writer --- WGO" <Kathryn.Grant@xxxxxxxxxxxxxxxxx>
Date: Wed, 18 Feb 2004 11:11:42 -0800
Hello,

I'm trying to sort an XML file--here's a representative record:

<SAVEIdea>
      <SAVE_ID>25</SAVE_ID>
      <date_submitted>01/14/2004</date_submitted>
      <employee>Kathryn Grant</employee>
      <department>OPE</department>
      <idea>Buy faster printers.</idea>
      <status_history>
         <status timestamp="1/20/04, 4:33:13 PM" userID="GRANT01">Submitted for supervisor review</status>
         <status timestamp="1/25/04, 9:21:45 AM" userID="GRANT01">Submitted for CFO review</status>
         <status timestamp="1/29/04, 6:12:22 PM" userID="GRANT01">Approved</status>
      </status_history>
   </SAVEIdea>

The name of the tag by which I want to sort is passed as a parameter to the XSL file from a web page using javascript. Below is the XSL, and the sort works for every column except the Status column (last column). 

As you can see in the XML file, the status tag is a level deeper than the other tags I'm sorting on. In addition, I'm pulling the last of all the status tag. So how can I make the status sort work?

Thanks in advance!

Kathryn

<TABLE border="0" width="92%" style="font-size: 10pt" cellspacing="1" cellpadding="1">

<tr>
<th><a href="javascript:View1()"><b>SAVE ID</b></a></th>
<th><a href="javascript:View2()"><b>Date Submitted</b></a></th>
<th><a href="javascript:View3()"><b>Submitted by</b></a><br/>
	<a href="javascript:View4()"><b>(Department)</b></a></th>
<th><b>Idea</b></th>
<th><a href="javascript:View5()" style="color:#ffffff"><b>Status</b></a></th>
</tr>


<xsl:for-each select="//SAVEIdeas/SAVEIdea">
    <xsl:sort select="*[name()=$param1]"/>
<tr>
 
  <td style="font-size:8pt" valign="top">
     <a href='javascript:loadnew2({SAVE_ID})'><xsl:value-of select="SAVE_ID"/></a>
  </td>

  <td style="font-size:8pt" valign="top">
    <xsl:value-of select="date_submitted"/>
  </td>

  <td style="font-size:8pt" valign="top">
    <xsl:value-of select="employee"/> (<xsl:value-of select="department"/>)
  </td>

  <td style="font-size:8pt" valign="top">
        <xsl:value-of select="idea"/>
  </td>

  <td style="font-size:8pt" valign="top">
        <xsl:value-of select="status_history/status[last()]"/>
  </td>

</tr>
</xsl:for-each>
</TABLE>


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread