[xsl] XSL:Sort-By

Subject: [xsl] XSL:Sort-By
From: Gavin Myers <GavinM@xxxxxxxxx>
Date: Tue, 24 Apr 2001 11:49:07 -0500
Hello, right now we have a bunch of reports that all look the same, but use
different xml files.

example:

<SpendingHabits>
<User ID="1" Name="John Doe" Department="Sales" Spent = "20">
<User ID="2" Name="Larry Doe" Department="Sales" Spent = "540">
<User ID="3" Name="George Franklin" Department="Marketing" Spent = "10">
</SpendingHabits>

I'd like to take all these reports and change them to something like this:

<Report Name="Spending Habits">
<ReportData Location="Header">
<Field Name="Name"/>
<Field Name="Department"/>
<Field Name="Spent"/>
</ReportData>
<ReportData Location="Body">
<Entry ID="1">
<Field Name="Name">John Doe</Field>
<Field Name="Department">Sales</Field>
<Field Name="Spent">20</Field>
</Entry>
<Entry ID="2">
<Field Name="Name">Larry Doe</Field>
<Field Name="Department">Sales</Field>
<Field Name="Spent">540</Field>
</Entry>
<Entry ID="3">
<Field Name="Name">George Franklin</Field>
<Field Name="Department">Marketing</Field>
<Field Name="Spent">10</Field>
</Entry>
</ReportData>
</Report>

With this xml the I can use the same xsl file for all of the hundreds of
reports (since they all look the same)

They return like this:

Header1	Header2	Header3	Header4
Value1.A	Value2.A	Value3.A	Value4.A
Value1.B	Value2.B	Value3.B	Value4.B
Value1.C	Value2.C	Value3.C	Value4.C

But, with this current xml structure can I sort by Name, Department and
Spent, since they are no-longer unique?

Does this make sense?

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


Current Thread