Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: XML::Simple : element vs. attribute in XMLout

by ikegami (Pope)
on May 26, 2010 at 14:45 UTC ( #841740=note: print w/ replies, xml ) Need Help??


in reply to Re^2: XML::Simple : element vs. attribute in XMLout
in thread XML::Simple : element vs. attribute in XMLout

You can always transform the tree programmatically before XMLout.

for my $elem (@{ $tree->{arr}{elem} }) { $elem->{mod}{content} = delete($elem->{mod}); }

For what it's worth, keep in mind your existing code will break if a mod element acquires an attribute. (Don't you love the fragility of XML::Simple?)


Comment on Re^3: XML::Simple : element vs. attribute in XMLout
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://841740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-09-17 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (89 votes), past polls