Archived
1
0

Group with id have now a completed ID

This commit is contained in:
Mercier Pierre-Olivier 2013-09-24 04:19:44 +02:00
parent 0f385f3838
commit 3f337f9eb9

View File

@ -154,6 +154,7 @@ sub new ($$)
{
my $class = shift;
my $self = {
groups => [],
parsed => shift,
inComment => "",
inEval => "",
@ -205,7 +206,11 @@ sub start_element
$self->{values} = "";
}
elsif ($element->{Name} ne "group" && $element->{Name} ne "name" && $element->{Name} ne "statut" && $element->{Name} ne "status" && $element->{Name} ne "log") {
elsif ($element->{Name} eq "group")
{
push @{ $self->{groups} }, ($element->{Attributes}{"{}id"}{Value} // "");
}
elsif ($element->{Name} ne "name" && $element->{Name} ne "statut" && $element->{Name} ne "status" && $element->{Name} ne "log") {
croak "Not a valid trace XML: unknown tag ".$element->{Name};
}
}
@ -231,6 +236,10 @@ sub end_element
if ($self->{inValue} ne NO_ID_VALUE and $1) {
$self->{parsed}{ids}{ $self->{inValue} } = $1;
}
if ($self->{groups}) {
my $key = @{ $self->{groups} }[$#{ $self->{groups} }];
$self->{parsed}{ids}{ $key } += $1;
}
}
$self->{inValue} = "";
}
@ -260,6 +269,10 @@ sub end_element
}
$self->{inInfo} = "";
}
elsif ($element->{Name} eq "group")
{
pop @{ $self->{groups} };
}
}
1;