Subject:Need Help Resorting Author:Brian B Date:06 Jul 2005 08:42 AM
I have a xsl sheet that gets 21 records sorted descending by date.
What i'm looking to do is after the 21 records resort by title without
out changing the 21 records, tables, rows, and column layout.
Subject:Need Help Resorting Author:Brian B Date:06 Jul 2005 01:10 PM
The rss feed gets filled with a screen scrape I made. When the xml file is complete it has about 200 records in order by title. I would like get 21 records sorted by date descending first then resort the same 21 records by title in the XSL file.
Subject:Need Help Resorting Author:Brian B Date:06 Jul 2005 06:15 PM
The way my XSL file is now I get the First Results. I want First Results then Second Results.
Also the reason I didn't use
<xsl:if test="position() mod 3 = 1">
and
<xsl:for-each select="//item[position() < 22]">
it only sorts the first 21 records by date. It doesn't go thur all the records then sort.
Here's a sample
First Results
title - date
B ----- Jul 3, 2002
A ----- Jun 19, 2002
C ----- Jan 16, 2002
Second Results
title - date
A ----- Jun 19, 2002
B ----- Jul 3, 2002
C ----- Jan 16, 2002
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="test.xsl"?>
<rss>
<item>
<title>A</title>
<description>something</description>
<image>JPG</image>
<month>7</month>
<date> Jun 19, 2002 </date>
<link>a href</link>
</item>
<item>
<title>B</title>
<description>something</description>
<image>JPG</image>
<month>8</month>
<date> Jul 3, 2002 </date>
<link>a href</link>
</item>
<item>
<title>C</title>
<description>something</description>
<image>JPG</image>
<month>1</month>
<date> Jan 16, 2002 </date>
<link>a href</link>
</item>
</rss>
This rss file goes down to 200 records in order by title
<a><strong>Order by date</strong></a>
<xsl:apply-templates select="msxml:node-set($ItemsByDate)/rss"/>
<a><strong>Order by title</strong></a>
<xsl:apply-templates select="msxml:node-set($ItemsByTitle)/rss"/>
Subject:Need Help Resorting Author:Brian B Date:06 Jul 2005 11:15 PM
That fixed the error but i'm sorry that not what I wanted. The way you have it I get 21 records showing in order by date then I get 21 records showing in order by title. I only want to see the records order by title but it needs to be the same records as ordered by date.
Example say if I wanted 5 records out of 10
Here's the 10 records in my xml file already ordered by title.
title --- date
A ------- 1/16/2005
B ------- 3/7/2005
C ------- 8/27/2005
D ------- 4/22/2005
E ------- 9/12/2005
F ------- 2/28/2005
G ------- 11/4/2005
H ------- 6/5/2005
I ------- 12/25/2005
J ------- 5/22/2005
If I take 5 records in order by title I get
title --- date
A ------- 1/16/2005
B ------- 3/7/2005
C ------- 8/27/2005
D ------- 4/22/2005
E ------- 9/12/2005
If I take 5 records in order by descending date I get
title --- date
I ------- 12/25/2005
G ------- 11/4/2005
E ------- 9/12/2005
C ------- 8/27/2005
H ------- 6/5/2005
The only thing I want to see is the records order by descending date but resorted by title.
Final Result
title --- date
C ------- 8/27/2005
E ------- 9/12/2005
G ------- 11/4/2005
H ------- 6/5/2005
I ------- 12/25/2005
If this is too much I appreciate what you have done.