Does this help?
You start with xml2XMLRules pm973038.xml and then you're running on steriods ( XML::Rules is XML::Simple on steriods )
#!/usr/bin/perl -- #~ 2012-05-29-09:18:14 by Anonymous Monk #~ perltidy -csc -otr -opr -ce -nibc -i=4 use strict; use warnings; use XML::Rules; use Data::Dump qw/ dd /; @ARGV or die "Usage: pm973038.pl pm973038.xml\n"; Main( @ARGV ); exit( 0 ); sub Main { my( $xmlfile ) = @_; my $t = XML::Rules->new( qw/ stripspaces 8 /, rules => [ 'bad_info,bar_number,foo_datum,good_info,timestamp,ugly_info,unique_id +entifier' => 'content', 'bar,foo,thing' => 'as array no content', 'bad,bars,eggsmell,foos,good,things,ugly' => 'no content' ], ); my $res = $t->parsefile( $xmlfile ); dd $res; } ## end sub Main __END__ $ perl pm973038.pl pm973038.xml | perltidy { eggsmell => { things => { thing => [ { bars => { bar => [ { bad => { bad_info => -1.5 }, bar_number => 0, good => { good_info => -118 }, ugly => { ugly_info => 7.5 }, }, { bad => { bad_info => 0 }, bar_number => 1, ugly => { ugly_info => 3.5 } }, ], }, foos => { foo => [ { foo_datum => "ABC" }, { foo_datum => "XY +Z" } ] }, unique_identifier => 23456, }, { bars => { bar => [ { bad => { bad_info => -1.5 }, bar_number => 0, good => { good_info => -116 }, ugly => { ugly_info => 7.5 }, }, { bad => { bad_info => 0 }, bar_number => 1, ugly => { ugly_info => 3.5 } }, ], }, foos => { foo => [ { foo_datum => "SOS" }, { foo_datum => "FM +L" } ] }, unique_identifier => 23458, }, ], }, timestamp => "2011-05-09 23:05:33", }, }
In reply to Re: I (Think I) Need to Break Up with XML::Simple and I Don't Know Where to Turn
by Anonymous Monk
in thread I (Think I) Need to Break Up with XML::Simple and I Don't Know Where to Turn
by Randomice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |