Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
Say I have that file, and I just want to open it up, add ten to each number, then save it again with the new numbers, which module should I use and how?<data> <fields> <field name="foo"> <number>2</number> <required>Y</required> </field> <field name="bar"> <number>1</number> <required>N</required> </field> </fields> </data>
I'm finding it impossible to do with XML::Simple using what I thought would be the correct method, XMLout() and printing to a file, because it rearranges the data, no matter what fiddling I do with forcearray and keyattr options, for instance it will output as:
<opt> <fields name="field"> <foo required="Y" number="12" /> <bar required="N" number="11" /> </fields> </opt>
Can anyone give me a quick recipe for this? It's late in the day and I'm not thinking straight any more.
--
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
M-J D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Edit values in XML and Save?
by grantm (Parson) on Mar 05, 2003 at 07:14 UTC | |
by alincoln (Acolyte) on Oct 29, 2003 at 12:55 UTC | |
|
Re: Edit values in XML and Save?
by mirod (Canon) on Mar 05, 2003 at 08:49 UTC | |
|
Re: Edit values in XML and Save?
by robartes (Priest) on Mar 05, 2003 at 07:40 UTC | |
|
Re: Edit values in XML and Save?
by benn (Vicar) on Mar 05, 2003 at 16:29 UTC | |
by Cody Pendant (Prior) on Mar 06, 2003 at 00:27 UTC |