Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: XML processing

by shreya (Novice)
on Aug 10, 2005 at 22:59 UTC ( #482799=note: print w/replies, xml ) Need Help??


in reply to XML processing

I started using XML:Twig. However facing a problem.

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 ins +tead 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
$ElementA .= $element->print;
Pls advice. Thanks,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://482799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2020-05-28 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (165 votes). Check out past polls.

    Notices?