]> git.sesse.net Git - xml-template/blobdiff - perl-sax/XML/TemplateSAX/Handler.pm
Fix include for perl-sax. Now only need to fix the test.
[xml-template] / perl-sax / XML / TemplateSAX / Handler.pm
index 93c19870aad87871472c89e2c3eea7751f7126ed..a0a40b2558ac76cc56014c0c4e3f8028d11295a4 100644 (file)
@@ -57,7 +57,8 @@ sub start_element {
 
                if (defined($match)) {
                        $self->SUPER::start_element($data);
-                       
+               
+                       # FIXME: we should match on something better than the name. But what?
                        push @{$self->{'stack'}}, [ $data->{'Name'}, $obj ];
 
                        #
@@ -85,6 +86,15 @@ sub start_element {
                                $self->{'obj'} = XML::TemplateSAX::Buffer->new($match);
                                return;
                        }
+
+                       #
+                       # If someone tries to insert a full tree, do it, just like the character
+                       # replacement above.
+                       #
+                       if (ref($match) eq 'XML::TemplateSAX::Buffer') {
+                               $match->replay($self);
+                               $self->{'obj'} = undef;
+                       }
                        
                        $self->{'obj'} = $match;
                        return;