Take a look at the module LibXML. XPath is what I use for grabbing or changing nodes in XML. The LibXML module comes with example scripts using XPath and there are XPath tutorials out there.
#************************************************** # # pass this the xml file name. # uses LibXML and XPath to find the username. # sub connect_check { my ($xml_file) = @_; use XML::LibXML; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($xml_file); foreach my $element ($doc->findnodes("//USERNAME")) { my $user = $element->to_literal; print "$xml_file,$user,-\n"; } }
In reply to Re: XML::Twig Help
by Gulliver
in thread XML::Twig Help
by onegative
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |