http://www.perlmonks.org?node_id=841727


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 <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: XML::Simple : element vs. attribute in XMLout
by ikegami (Patriarch) 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?)