in reply to Re: Help with attributes and XML::Simple
in thread Help with attributes and XML::Simple
If you've got a reasonably recent version of XML::LibXML, that can be made even simpler.
use XML::LibXML 1.94; use Data::Dumper; my %hash = XML::LibXML -> load_xml(location => 'mydata.xml') -> getElementsByTagName('Vendor') -> map(sub { $_->{vendorUniqueKey} => $_->{name} }); print Dumper \%hash;
|
|---|