XML::LibXML
- wrapper around libxml2
my $parser = XML::LibXML->new(); my $doc = $parser->parse_fh($filename); my $type = $doc->findvalue('//greeting/@type'); say "greeting type: $type"; __DATA__ <greeting type="casual">Hi!</greeting>
my $parser = XML::LibXML->new(); my $doc = $parser->parse_fh($filename); my $type = $doc->findvalue('//greeting/@type'); say "greeting type: $type"; __DATA__ <greeting type="casual">Hi!</greeting>