- #
- # If we have multiple elements with the same name within each other,
- # we need to keep track of how many there are, so check here and increment.
- # end_element will decrement and optionally pop the stack.
- #
- my $stack = $self->{'stack'};
- if (scalar @$stack > 0) {
- my $top = $stack->[scalar @$stack - 1];
-
- if ($data->{'Name'} eq $top->[0]) {
- ++$top->[1];
- }
- }
-
- # within a replacement; just ignore everything
- return if (!defined($obj));
-
- # within a cloning; slurp it up
- if (ref($obj) eq 'XML::TemplateSAX::Buffer') {
- $obj->start_element($data);
- return;
- }