Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2004, 11:47 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP! More complicate sorting nodes question

I have the xml as follows:

<class name="2001">
<student ************="F">Ann</student>
<student ************="M">Bob</student>
<student ************="F">Cindy</student>
<student ************="F">Dianne</student>
<student ************="M">Eric</student>
...
</class>
<class name="2002">
<student ************="M">Frank</student>
<student ************="F">Gina</student>
...
...
</class>

Now I want to use XSL to transform the xml to a csv file like:

Class,FemaleStudent,MaleStudent
2001,Ann,Bob,
,Cindy,Eric
,Dianne,,
...
2002,Gina,Frank,
...

So, the output will look like this in excel:

Class|Female|Male
------------------
2001
------------------
     |Ann |Bob
------------------
     |Cindy |Eric
------------------
     |Dianne|
------------------
2002 | |
------------------
     |Gina |Frank
------------------
...

The hardest part is to sort the student nodes based on ************, but the student node come randomly, also I want to write the outuput to two columns.

Will that be easier if I sort the dom before applying the xsl?

Any help would be appreciated!



Kevin
 
Old April 8th, 2004, 02:58 PM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any gurus out there? Or maybe this one is too hard?


Kevin
 
Old April 13th, 2004, 05:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I assume you're having problems with the FMFMFM... sorting? Your problem reminds me of this topic http://p2p.wrox.com/topic.asp?TOPIC_ID=4714
does that solution help?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding and Sorting nodes georgemeng XSLT 4 December 1st, 2008 12:13 PM
Sorting some nodes by attribute value acw274 XSLT 8 July 2nd, 2008 01:22 AM
A simple Sorting question bonekrusher XSLT 2 November 25th, 2007 09:40 AM
Sorting on similar tags question terrypink XSLT 21 April 2nd, 2007 02:55 PM
Data View Sorting Question jazzcatone ASP.NET 1.0 and 1.1 Basics 0 October 3rd, 2006 09:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.