Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

by rovf (Priest)
on May 26, 2010 at 13:32 UTC ( #841727=note: print w/replies, xml ) Need Help??

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

This is likely correct. I haven't checked this yet, because I was hoping for a solution which would work with the *present* internal representation, because it would spare me from modifying existing code which already assumes the hash to be constructed in the way it is right now.

Ronald Fischer <>

Replies are listed 'Best First'.
Re^3: XML::Simple : element vs. attribute in XMLout
by ikegami (Pope) on May 26, 2010 at 14:45 UTC

    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?)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://841727]
[karlgoethebier]: or no education?
[choroba]: their = his or her
[Discipulus]: anyway once I proposed an automatic font decrease for post below -1, stepping every 5 votes: i'm still thinks it's a good idea but dunno if feasible
[shmem]: ...emulated dual in english
[shmem]: Discipulus: has that been in the CB? or in a PM node proper? for the latter case, can you provide the ID?
[Discipulus]: you seriously can use their in this way in eng?
[Corion]: Meh. $effin_bad_system has an interface breakdown and then loads events in parallel with events overtaking one another instead of being processed sequentially
[shmem]: Discipulus: dunno, but we do all the time ^^
[choroba]: Discipulus I was taught so by a Londoner
[shmem]: Corion: very clear case of missing sequence number

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2017-05-23 08:21 GMT
Find Nodes?
    Voting Booth?