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

Sorting Issue

Subject: Sorting Issue
From: "SHEIKH Sajjad" <Sajjad.SHEIKH@xxxxxxxxxxx>
Date: Wed, 21 Jan 2004 15:56:53 +0100
 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


Current Thread
  • Sorting Issue
    • SHEIKH Sajjad - Wed, 21 Jan 2004 09:52:10 -0500 (EST) <=
      • <Possible follow-ups>
      • SHEIKH Sajjad - Thu, 22 Jan 2004 04:02:54 -0500 (EST)

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.