Isanchez has asked for the wisdom of the Perl Monks concerning the following question:
use File::Find; use XML::Twig; use XML::Encoding; find(\&getFolder, $dir1); @files=(); $found =0; &getFolder; sub getFolder{ # retrieve files recursively $file = $File::Find::name; # if the file is an xml file if ($file =~ /\.xml$/) { open (FILE, $file) ; $twig= XML::Twig->new(); $twig ->parsefile( $file ); $root = $twig->root; @nodes = $root->descendants; foreach $node (@nodes){ $tag = $des -> gi ; ==> here I would like to get and print out the text of the att +ributes of each node $node } } # if the file is xml close FILE; } #sub close dir1; close IN;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: retrieving attribute text with xml::twig
by mirod (Canon) on Jul 11, 2003 at 00:47 UTC | |
by Anonymous Monk on Jul 13, 2003 at 02:02 UTC |