Subject: Re: [xsl] Converting from <dt><dd> pairs to better XML From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx> Date: Fri, 03 Sep 2010 08:58:21 +0200 |
Thanks to everyone who helped in my original question
With your assistance, I was able to convert <dl> <dt>AAA</dt> <dd>111</dd> <dt>BBB</dt> <dd>222</dd> <dt>BBB</dt> <dd>333</dd> <dt>BBB</dt> <dd>444</dd> <dt>CCC</dt> <dd>555</dd> <dt>CCC</dt> <dd>666</dd> <dt>EEE</dt> <dd>777</dd> </dt>
into
111|222,333,444|555,666|777
Unfortunately, it was only after that when I found that the supplier of my data decided to make a variable and arbitrary number of distinct <dd><dt> pairs from one record to the other, so I need to massage the result further before it's suitable to go into the pipe-separated file that I need.
What I really need is actually 111|222,333,444|555,666||777
(... for the above record, because it had no data under "DDD")
So I think I need to do a two-pass solution,
1) On the first pass, to convert the above example data to <AAA>111</AAA> <BBB>222,333,444</BBB> <CCC>555,666</CCC>
So I *do* need to group by DT but I am able to assume only one<dd> value following each<dt>
2) On the second pass I extract only those fields that I need (and give null entries for those that have no supplied data).
The second pass I think I know how to do, but the first pass still eludes me because of the "following-sibling" magic whose syntax and context still eludes me at this moment. I'm trying to deconstruct the examples you've sent me, but it hasn't been easy.
Any help (especially with the first pass) will be greatly appreciated.
- Evan
-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930
GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard VC6ckler
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Converting from <dt><dd> , Evan Leibovitch | Thread | Re: [xsl] mode computation case, ac |
Re: [xsl] mode computation case, ac | Date | Re: [xsl] mode computation case, David Carlisle |
Month |