You can use perl's XML::Simple module, it's easy to use too
#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; my $xml = new XML::Simple; my $data = $xml->XMLin("test.xml"); print Dumper $data; print "$data->{'group'}{'gotoButton'}{'name'} - "; print "$data->{'group'}{'gotoButton'}{'display'}\n"; print "$data->{'gotoButton'}{'name'} - "; print "$data->{'gotoButton'}{'display'}\n"; Output: $VAR1 = { 'gotoButton' => { 'imageSettings' => { 'imageName' => '', 'alignment' => 'middleCen +ter' }, 'caption' => { 'fontFamily' => 'Arial', 'caption' => 'TO CRXW616 AIR/OIL', 'fontSize' => '9' }, 'name' => 'GotoDisplayButton12', 'display' => '36 AIR_OIL SYSTEM SETUP_2' }, 'group' => { 'gotoButton' => { 'imageSettings' => { 'imageName' => + '', 'alignment' => + 'middleCenter' }, 'caption' => { 'fontFamily' => 'Ari +al', 'caption' => 'MAIN M +ENU', 'fontSize' => '9' }, 'name' => 'GotoDisplayButton3', 'display' => '19 UNIT STATUS' }, 'visible' => 'true', 'wallpaper' => 'false', 'name' => 'Group1', 'isReferenceObject' => 'false' } }; GotoDisplayButton3 - 19 UNIT STATUS GotoDisplayButton12 - 36 AIR_OIL SYSTEM SETUP_2
Using dumper, you will get the data inside the xml file in perl datastructure i.e, hash of hashes or arrays from which data can be pulled out in similar manner as I have mentioned in code.
In reply to Re: Perl LibXML Help.
by simmisam
in thread Perl LibXML Help.
by DunLidjun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |