[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|