in reply to Re: XML::Twig - can't find my uncle!
in thread XML::Twig - can't find my uncle!

aardvark,
Thanks for looking in to this. As it turns out, I need to get the request only when there is an error and i need to co-relate these, so the code you are not seeing in my piddling example creates a nice structure to process, allowing requests to be repaired and re-submitted from a Web page.
The print_request subroutine will fire for all requests, I believe, which leads to behavior that I don't want. I will see if mirod responds with something.
Again, thanks for your time,
DrSax
  • Comment on Re: Re: XML::Twig - can't find my uncle!

Replies are listed 'Best First'.
Re: Re: Re: XML::Twig - can't find my uncle!
by aardvark (Pilgrim) on May 23, 2001 at 09:02 UTC
    ok, how about this?
    use strict; use XML::Twig; my $file = 'uncle.xml'; my $twig = new XML::Twig; $twig->parsefile($file); my $root = $twig->root; my @messages = $root->children; foreach my $msg (@messages) { my $error = $msg->first_child('error'); my $result = $msg->first_child('request'); my $error_name = $error->att('name'); my $result_name = $result->att('name'); if ($error_name && $result_name) { print "ERROR : $error_name \n"; print "RESULT : $result_name \n"; } }
    Get Strong Together!!