in reply to Writing Out XML using XML::Simple
One last note, i rarely have to add anything to the XML files that i use. Instead, data is typically stored somewhere else (a database usually) and i use XML as an intermediary transformation. This way, the need to edit an XML file is aleviated, instead, i change the data in the database and create a new XML file. This doesn't always work, but it seems like a much better way to go in the long run ... YMMV, of course. ;)use strict; use warnings; use XML::XPath; use CGI::Pretty qw(:standard); my $xpath = XML::XPath->new(ioref => *DATA); my $nodeset = $xpath->find('/profile/bids/itemcode'); my @b_item = map $_->string_value, $nodeset->get_nodelist; print header, start_html('itemcodes'), h1('Then'), (map { $_,br } @b_item), end_html, ; __DATA__ <profile username="Tom" language="eng" lastlogin=""> <bids> <itemcode>4985874875</itemcode> <itemcode>7685976785</itemcode> <itemcode>6758679837</itemcode> <itemcode>7849609576</itemcode> <itemcode>2857689576</itemcode> </bids> <itemwatch> <itemcode>6758767856</itemcode> <itemcode>3758678576</itemcode> </itemwatch> </profile>
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: Writing Out XML using XML::Simple
by CodeJunkie (Monk) on Apr 07, 2003 at 14:51 UTC | |
by jeffa (Bishop) on Apr 07, 2003 at 14:59 UTC | |
by CodeJunkie (Monk) on Apr 08, 2003 at 10:44 UTC | |
by CodeJunkie (Monk) on Apr 08, 2003 at 11:22 UTC |