Using:
the Data:umper gives me:
It's not formatted exactly correct but I basically want to get all of the interval=>names for the business_area client_system and so far I have:
or something like that. Probably have to loop through again to get all the interval names. Just confused with the syntax. Thanks in advance
Code:
my $doc = $xs1->XMLin($file, forcearray => 1, keyattr => {client_system => 'Customer Care'});
the Data:umper gives me:
Code:
$VAR1 =
{
'client_system' => [
{
'business_area' => [
{
'component' => [
{
'component_lib' => [
{
'class_set' => [
{
'data_type' => '1',
'linked_name' => 'ACLI-4-MTH-AVG-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' => 'Active Strategy 2'
}
]
}
],
'type' => 'class_set'
}
]
}
],
'name' => 'GM Business Area',
'analytics' => [
{}
]
}
],
.
.
.
It's not formatted exactly correct but I basically want to get all of the interval=>names for the business_area client_system and so far I have:
Code:
my $doc = $xs1->XMLin($file, forcearray => 1, keyattr => {client_system => '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}{'name'}, "\n";
}
}
or something like that. Probably have to loop through again to get all the interval names. Just confused with the syntax. Thanks in advance