in reply to Re: problem in XML parsing
in thread problem in XML parsing
I don't like XML::Simple. Remove a team from the sample data and you get
Not an ARRAY reference at 675580.pl line 16.
Remove a player from ONE and you'll get
ONE Not an ARRAY reference at 675580.pl line 18.
The call to XMLin for this schema should be *at least*
my $teams = XMLin( $xml_text, ForceArray => [qw( football_team Player )], );
And then there's ForceContent.
XML::Simple is deceptively complex to use because it returns data in an unpredictable format, forcing you to use ref all over the place or to specify arguments to tell it what it already knows but chooses to destroy. All that because XML::Simple assumes attributes and elements are interchangeable. (Are they ever?)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: problem in XML parsing
by hipowls (Curate) on Mar 22, 2008 at 07:03 UTC |