]> git.sesse.net Git - xml-template/commitdiff
Fix the cleaner so it doesn't confuse the layers above. All perl-sax tests
authorsgunderson@bigfoot.com <>
Thu, 1 Mar 2007 14:28:51 +0000 (15:28 +0100)
committersgunderson@bigfoot.com <>
Thu, 1 Mar 2007 14:28:51 +0000 (15:28 +0100)
passes again!

perl-sax/XML/TemplateSAX/Cleaner.pm

index e5f784acd2c11332d33bd149cc9d8bb0c1938b6b..6269306fb8c8b3912566cb5699302a9e39361222 100644 (file)
@@ -7,9 +7,12 @@ use base qw(XML::SAX::Base);
 
 sub start_element {
        my ($self, $data) = @_;
-       my $attrs = $data->{'Attributes'};
-       
        return if ($data->{'NamespaceURI'} eq 'http://template.sesse.net/');
+
+       # we need to make a copy here, or we'll confuse the upper layers.
+       $data = { %$data };
+       my $attrs = $data->{'Attributes'} = { %{$data->{'Attributes'}} };
+       
        for my $a (keys %$attrs) {
                if ($attrs->{$a}->{'NamespaceURI'} eq 'http://template.sesse.net/') {
                        delete $attrs->{$a};