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

sort elements in external document

Subject: sort elements in external document
From: Vaduvoiu Tiberiu <vaduvoiutibi@xxxxxxxxx>
Date: Tue, 15 May 2007 05:41:55 -0700 (PDT)
 sort elements in external document
I want to sort an xml document by data from an external document. Let me see if I can explain this: I have list.xml:

<list>
    <file>file1.xml</file>
    <file>file2.xml</file>
...
    <file>file100.xml</file>
<list>

each of the fileX.xml have inside a date tag: <date>20071015102000</date>(yyyymmddhhmmss). I want to sort the list.xml by the date in each file. The way I did it:
<xsl:for-each select="file">
<xsl:variable name="filename" select="file"/>
<xsl:sort order="descending" select="document($filename)/date">

   File:    <xsl:value-of select=".">     Date: <xsl:value-of select="document($filename)/date">
</xsl:for-each>

The document will list the dates but it doesn't sort them.

I also tried <xsl:sort order="descending" data-type="number" select="document($filename)/date"> but it doesn't work. It sorts the list alphabetically after the name of file...file1,file2...file100. What am I doing wrong? 10x


       
____________________________________________________________________________________Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

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.