The Widget::Include module uses a SAX parser to
parse the included file and send it as SAX events
to the downstream handlers. Unfortunately, this
event stream include start_document() and end_document() - downstream handlers probably only expect to see one of each.
I'd suggest setting a flag around the parse:
$self->{in_include} = 1;
$p->parse_uri( $uri ); # original line
$self->{in_include} = 0;
And implementing start/end_document handlers that
don't propagate the extra events, eg:
sub start_document {
my $self = shift;
$self->SUPER::start_document() unless($self->{in_include});
}
|