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

conditional multiline output

Subject: conditional multiline output
From: "Erwin Kloeck" <kloeck@xxxxxxxxx>
Date: Wed, 31 Jan 2007 10:30:05 +0100
 conditional multiline output
Hi,

I'd like to get some pointers with the following problem. I use saxon
8.8 and xsl 2.0

I have a list of date elements in my xml that I want to output in
columns in a csv file.
If the same date occurs more than once, I want another line in the
respective column
and the label in the first column.

I think I should group the dates and then cicle thru and output the
line with all 1st elements in the group, then all 2nd elements in the
second line etc.

I would appreciate some pointers at how to do this.

Thanks

Erwin

Here are my examples:

--- begin example.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<top>
   <logpoint value="AAA" >
       <date value="2007-01-01" count="1" string="aaa"/>
       <date value="2007-01-01" count="11" string="xxx"/>
       <date value="2007-01-02" count="2" string="bbb"/>
       <date value="2007-01-03" count="3" string="ccc"/>
       <date value="2007-01-03" count="4" string="ddd"/>
       <date value="2007-01-03" count="41" string="yyy"/>
       <date value="2007-01-04" count="5" string="eee"/>
   </logpoint>
   <logpoint value="BBB" >
       <date value="2007-01-01" count="31" string="lll"/>
       <date value="2007-01-02" count="32" string="mmm"/>
       <date value="2007-01-03" count="33" string="nnn"/>
       <date value="2007-01-04" count="34" string="ooo"/>
   </logpoint>
</top>
--- begin example.xml ---

desired output:
--- begin example.csv ---
logpoint;2007-01-01;2007-01-02;2007-01-03;2007-01-04;
AAA;aaa[1];bbb[2];ccc[3];eee[5];
AAA;xxx[11];;ddd[4];;
AAA;;;yyy[41];;
BBB;lll[31];mmm[32];nnn[33];ooo[34];
--- end example.csv ---

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-2007 All Rights Reserved.