in reply to Re: XML processing
in thread XML processing
my $twig = XML::Twig->new(twig_handlers => {a'=> \&Test ); # Parse the file $twig->parsefile($XmlFile); # Handler sub routine sub Test { my ($parser, $element) = @_; # This prints element <a> along with its contents to some out +put file $element->print(\*OP); # However What I really want done over here is have element <a> a +long with its subelements and text be copied to another variable inst +ead of being printed on screen }
Problem: What I really want done over here is have element along with its subelements and text be copied to another variable instead of being printed on screen
Something like
Pls advice.
Thanks,
$ElementA .= $element->print;
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: XML processing
by mirod (Canon) on Aug 10, 2005 at 23:13 UTC | |
|
Re^3: XML processing
by shreya (Novice) on Aug 11, 2005 at 19:07 UTC | |
by runrig (Abbot) on Aug 11, 2005 at 19:11 UTC |