Hello,
I've been teaching myself XSLT with the help of Michael's XSLT 2.0
book over the last few months. So far so good, but I think I've hit my
first roadblock.
I need to convert data from web pages into something usable in a
database. The data is in the format of
<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>
[...]
</dl>
There are variable numbers of each dt/dd combination, but they are
generally kept together by <dt> value.
Ultimately I'd like to convert this into a pipe-separated-value file
(with implied headers):
111|222,333,444|555,666|....
But for now I can work with either
<record>
<AAA>111</AAA>
<BBB>222</BBB>
<BBB>333</BBB>
<BBB>444</BBB>
<CCC>555</CCC>
<CCC>666</CCC>
</record>
or
<record>
<AAA id="111" />
<BBB id="222" />
<BBB id="333" />
<BBB id="444" />
<CCC id="444" />
<CCC id="444" />
</record>
which I then think I know how to process how I want. Even better would be
<record>
<AAA>111</AAA>
<BBB>222, 333, 444</BBB>
<CCC>555, 666</CCC>
</record>
Which would be easier to do?
Any tips suggestions or pointers are appreciated.
I'm using xslproc under Linux.
Evan Leibovitch
York University
Toronto
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--