in reply to Re^2: XML Simple not keeping same structure on xmlout()
in thread XML Simple not keeping same structure on xmlout()
use strict; use warnings; use Data::Dumper; use XML::Simple; # The fastest existing backend for XML::Simple. local $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; my $xs = XML::Simple->new( NoAttr => $ARGV[0], KeepRoot => 1, NormaliseSpace => 1, ); my $tree = $xs->parse_string( <<'__EOI__' ); <BILLING> <ACCOUNT></ACCOUNT> <RTN></RTN> </BILLING> __EOI__ print( Dumper( $tree ) ); print( $xs->XMLout( $tree ) );
$ perl a.pl 1 $VAR1 = { 'BILLING' => { 'RTN' => {}, 'ACCOUNT' => {} } }; <BILLING> <ACCOUNT></ACCOUNT> <RTN></RTN> </BILLING>
$ perl a.pl 0 $VAR1 = { 'BILLING' => { 'RTN' => {}, 'ACCOUNT' => {} } }; <BILLING> <ACCOUNT></ACCOUNT> <RTN></RTN> </BILLING>
Update: I originally said it produced a different structures.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: XML Simple not keeping same structure on xmlout()
by johnnytc4 (Novice) on Apr 20, 2011 at 18:25 UTC | |
by ikegami (Patriarch) on Apr 20, 2011 at 20:14 UTC | |
|
Re^4: XML Simple not keeping same structure on xmlout()
by johnnytc4 (Novice) on Apr 21, 2011 at 15:17 UTC |