Tobias Regneri wrote:
Given the following xml structure of the data to process

<List>
   <ListItem>
      <Name>Name1</Name>
      <Value>Val1</Value>
   </ListItem>
   <ListItem>
      <Name>Name2</Name>
      <Value>Val2</Value>
   </ListItem>
</List>

SOAP::Lite will build the internal representation

$VAR1 = [
          bless( {
                   'ListItem' => [
                                 bless( {
                                          'Name' => 'Name1',
                                          'Value' => 'Val1'
                                        } ),
                                 bless( {
                                          'Name' => 'Name2',
                                          'Value' => 'Val2'
                                        } )
                               ]
                 }, 'List' )
        ];


print $VAR1->[0]->{ListItem}->[0]->{Name}."\n";
would print "Name1".

# item key value pairs...
for my $item (@{$VAR1->[0]->{ListItem}}) {
  print "$item->{Name} => $item->{Value}\n";
}

Rob

Reply via email to