in reply to Re^2: Read the attribute from xml file
in thread Read the attribute from xml file
First suggestion: use XML::Twig instead of XML::Simple. There are some good tutorials out there.
XML::Simple reads in the XML data into a Perl data structure, but doesn't seem to give much help in working with it. If you use Data::Dumper you can print out the data structure and go from there. You'll get good with hash references!
In my own exploration, I found the following produced a more useful data structure than the default:
my $xml = XML::Simple; my $data = $xml->XMLin($filename, KeyAttr=>['identifier']);
In that way, the key to the hash containing the attributes is the identifier.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Read the attribute from xml file
by bhushanQA (Sexton) on Jul 21, 2015 at 10:00 UTC | |
by Anonymous Monk on Jul 21, 2015 at 10:31 UTC | |
by GotToBTru (Prior) on Jul 21, 2015 at 12:56 UTC |