then Data::Dumper gives me output like this:my $doc = $xs1->XMLin($file, forcearray => 1, keyattr => {client_syste +m => 'Customer Care'});
Sorry for the mess but I'm tired of formatting. Anyway, I basically want to get all of the interval=>names for the business_area client_system and I have:$VAR1 = { 'client_system' => [ { 'business_area' => [ { 'component' => [ { 'component_lib' => [ { 'class_set' => [ { 'data_type' => '1', 'linked_characteristic_name' => '4-MTH-AV +G-UTIL', 'version' => '2.0', 'name' => 'Active Strategy 2', 'is_protected' => 'false', 'base_class_set' => [ { 'interval' => [ { 'outcome' => [ { 'uniqueID' => '2', 'displayPosition' => '1', 'name' => 'low-199' } ], 'is_Others' => ['false'], 'range' => ['low-199'], 'name' => 'low-199' + + + }, + + { + + 'outcome' => [ + + + { + + 'uniqueID' => '3', + + + 'displayPosition' => '2', + + + 'name' => '200-499' } ], 'is_Others' => ['false'], 'range' => ['200-499'], 'name' => '200-499' }, { 'outcome' => [ { 'uniqueID' => '4', 'displayPosition' => '3' +, 'name' => '500-899' } ], 'is_Others' => ['false'], 'range' => ['500-899'], 'name' => '500-899' }, { 'outcome' => [ { 'uniqueID' => '1', 'displayPosition' => +'2147483647', 'name' => 'Others' } ], 'is_Others' => ['true'], 'name' => 'Others' } ] } ], 'obj_info' => [ { 'obj_revision' => '1', 'version' => '2.0', 'name' => 'CS A1524 CD GM Active Strategy +2', 'library_unique_id' => '00000071', } ] } ], 'type' => 'class_set' } ] } ], 'name' => 'GM Business Area', 'analytics' => [ {} ] } ], . . .
or something like that. Just confused with the syntax on the print command. Probably also have to loop through again to get all the interval names. Thanks in advancemy $doc = $xs1->XMLin($file, forcearray => 1, keyattr => {client_syste +m => 'Customer Care'}); foreach my $key (keys (%{$doc->{client_system}})){ if($key eq 'business_area') { print $doc->{client_system}[$key]->{component}[0]->{component_ +lib}[0]->{class_set}[0]->{base_class_set[0]->{interval}{'range'}, "\n +"; } }
In reply to Re^4: XML::Simple Multi-Layered
by eide
in thread XML::Simple Multi-Layered
by eide
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |