RE: [xsl] Sorting Issue

Subject: RE: [xsl] Sorting Issue
From: "SHEIKH Sajjad" <Sajjad.SHEIKH@xxxxxxxxxxx>
Date: Thu, 22 Jan 2004 10:07:37 +0100
Hi all,

Can we say that this sorting is not possible?

Regards,
/s

-----Original Message-----
From: SHEIKH Sajjad 
Sent: 21 January 2004 15:57
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Sorting Issue


Hi all,

Following style sheet processes multiple xml documents (lets say
file1.xml, file5.xml and file8.xml). It will sort all the results by
modificationDate seperately and will output the results as following.

link1	021203	(From File1)
link2	011203	(From File1)
link3	101103	(From File5)
link4	031203	(From File8)
link5	091103	(From File8)


I want to sort everything together.  For example,

link4	031203	(From File8)
link1	021203	(From File1)
link2	011203	(From File1)
link3	101103	(From File5)
link5	091103	(From File8)

Any suggestions?
Regards,
/s


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
  <xsl:apply-templates select="/someURIs/file"/> </xsl:template>

<xsl:template match="file">
  <xsl:variable name="copy_current_file" select="document(string(.))"/>
    <table><xsl:apply-templates select="$copy_current_file/ll"/></table>
</xsl:template>

<xsl:template match="ll">

	<xsl:variable name="find_file">
<xsl:for-each select="loc">
 <xsl:if test="position()=last()-1">(From <b><xsl:value-of
select="."/></b>)</xsl:if> </xsl:for-each>
	</xsl:variable>

 <xsl:for-each select="*//lln">
  <xsl:sort select="@modificationDate" order="descending"/>
      <xsl:choose>
       <xsl:when test="@objectname='Folder'">
	<tr>
	 <td>
		<a href="{@docname}/l.shtml">
	  	 <xsl:value-of select="n/@docname"/>
		</a>	
	 </td>
	 <td>
      		<xsl:value-of select="@identity"/>
	 </td>
	 <td>
      		<xsl:value-of select="@modificationDate"/>
	 </td>

		<td><xsl:value-of select="$find_file"/></td>

	</tr>	
       </xsl:when>
      </xsl:choose>
 </xsl:for-each>
</xsl:template>

</xsl:stylesheet>

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


______________________________________________________________
This message has been checked for all viruses by BTnet VirusScreen. The
service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service, please
visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==============================================================

______________________________________________________________
This message has been scanned for all viruses by BTnet VirusScreen. The
service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service, please
visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==============================================================

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


Current Thread