Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: XML processing

by shreya (Novice)
on Aug 10, 2005 at 22:59 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://482799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found