[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: FW: Troubleshooting a sort

Subject: RE: FW: Troubleshooting a sort
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Thu, 19 Feb 2004 20:23:13 +0100
RE:  FW: Troubleshooting a sort
> -----Original Message-----
> From: Grant, Kathryn
>
> Thanks for the idea--unfortunately, it didn't work. The first
> four sorts still worked fine, but this time the Status sort
> simply repeated the status of the first record for all the
> records. I guess this is one of those //-related bugs you were
> talking about :)
>
> If anyone has any other ideas, I'd welcome them.
>

Hi,

I have a vague suspicion that the culprit of your little problem is actually
the use of the last() function... (in combo with the sorted for-each)

What exactly do you need to achieve there?

If you need the last status element of the current SAVEIdea, you could try
something like the following :

change the last table-cell to

  <td style="font-size:8pt" valign="top">
    <xsl:apply-templates select="status_history">
      <xsl:sort select="{sort-on}" />
    </xsl:apply-templates>
  </td>

and add the following template to your stylesheet

<xsl:template match="status_history">
  <xsl:value-of select="status[last()]" />
</xsl:template>

This way, the context for the last() function will be correctly switched to
the sorted set of status elements in the current SAVEIdea being processed,
rather than the last one in the node-set you are processing with the
for-each.

Hope this helps!

Cheers,

Andreas


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.