Subject: Re: [xsl] Converting from <dt><dd> pairs to better XML From: Evan Leibovitch <evanleibovitch@xxxxxxxxx> Date: Thu, 2 Sep 2010 20:10:42 -0400 |
Thanks to everyone who helped in my original question With your assistance, I was able to convert <dl> B <dt>AAA</dt> B <dd>111</dd> B <dt>BBB</dt> B <dd>222</dd> B <dt>BBB</dt> B <dd>333</dd> B <dt>BBB</dt> B <dd>444</dd> B <dt>CCC</dt> B <dd>555</dd> B <dt>CCC</dt> B <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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Bug in format-number ? U, G. Ken Holman | Thread | Re: [xsl] Converting from <dt><dd> , Imsieke, Gerrit, le- |
Re: [xsl] Bug in format-number ? U, G. Ken Holman | Date | Re: [xsl] mode computation case, ac |
Month |