Group with id have now a completed ID
This commit is contained in:
parent
0f385f3838
commit
3f337f9eb9
15
ACU/Trace.pm
15
ACU/Trace.pm
@ -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;
|
||||
|
Reference in New Issue
Block a user