#! /usr/bin/perl

use strict;
use warnings;
use XML::TemplateSAX;
use Data::Dumper;
package XML::TemplateSAX::Deferred;

sub new {
	my $class = shift;
	my ($filename, $obj, $clean) = @_;

	my $self = {
		filename => $filename,
		obj => $obj,
		clean => $clean
	};
	bless($self, $class);
	return $self;
}

sub parse {
	my ($self, $handler) = @_;

	my $buf = XML::TemplateSAX::process_file_to_buffer($self->{'filename'}, $self->{'obj'}, $self->{'clean'});
	$buf->replay($handler);
	
	# XML::TemplateSAX::process_file_to_handler($self->{'filename'}, $handler, $self->{'obj'}, $self->{'clean'});
}

1;
