our $VERSION = '1.10';
+=head1 DESCRIPTION
+
+This subclass of L<XML::Twig> and L<Test::Valgrind::Parser::XML> encapsulates an L<XML::Twig> parser inside the L<Test::Valgrind::Parser> framework.
+It is able to parse the XML output from C<valgrind> up to protocol version 4 and to generate the appropriate reports accordingly.
+
+=cut
+
use Scalar::Util ();
use base qw/Test::Valgrind::Parser::XML Test::Valgrind::Carp XML::Twig/;
=head2 C<protocol_version>
-The version of the protocol that the stream is currently conforming to.
+The version of the protocol that the current stream is conforming to.
+It is reset before and after the parsing phase, so it's effectively only available from inside L</parse>.
=cut
sub parse {
my ($self, $sess, $fh) = @_;
+ $self->protocol_version(undef);
+
$self->XML::Twig::parse($fh);
$self->purge;
+ $self->protocol_version(undef);
+
return;
}