in reply to Perl LibXML Help.
#!/usr/bin/perl use warnings; use strict; use XML::LibXML; my $parser = 'XML::LibXML'->new(); my $doc = $parser->parse_file('file.xml'); for my $title ($doc->findnodes('//gotoButton')) { my $button = $title->getAttribute('name'); my $display = $title->getAttribute('display'); my $caption = $title->findvalue('caption/@caption'); print "$button\t$display: $caption\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl LibXML Help.
by DunLidjun (Acolyte) on Jan 29, 2014 at 16:17 UTC |