Herkum has asked for the wisdom of the Perl Monks concerning the following question:
I am using XML::Twig and setting twig_handlers to parse the actual document. The problem I am encountering is that the parser mysteriously dies parsing some relatively simple documents. Below are the handlers being called.
my $handlers = { 'request' => sub { $self->_handler_set_object('request', @_ ) +; # got to here with a warn statement }, $response => sub { $self->_handler_set_object('response', @_ ) +; $self->_object_tree( $response, @_ ) +; # Got to Here, with a warn statement }, }; eval { $self->twig( XML::Twig->new( twig_handlers => $handlers )) +}; croak 'ERROR: ' . $EVAL_ERROR if $EVAL_ERROR; # Got Here eval { $self->twig->parse( $self->get_xml ) }; # Cannot get to here croak 'ERROR: ' . $EVAL_ERROR . qq{\nXML: } . $self->get_xml if $E +VAL_ERROR;
I think the XML parsing engine is blowing up because I never get to the croak error message when it dies. I could upgrade the XML libraries and hope that fixes the problem but I am not familiar with what libraries I would have to update. I like Twig because the code was fairly easy to write, and would rather not have to use something more complex if I can avoid it.
Anyone got any ideas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Twig Unexplained Handler dies
by ikegami (Patriarch) on Nov 04, 2008 at 21:09 UTC | |
by Herkum (Parson) on Nov 04, 2008 at 21:13 UTC | |
by ikegami (Patriarch) on Nov 04, 2008 at 22:57 UTC | |
|
Re: XML::Twig Unexplained Handler dies
by GrandFather (Saint) on Nov 04, 2008 at 22:32 UTC | |
by Herkum (Parson) on Nov 04, 2008 at 22:54 UTC |