#!/usr/bin/perl

use XML::Filter::XSLT;
use XML::SAX::ParserFactory;
use XML::SAX::Base;

{
	package Foo;

	use base 'XML::SAX::Base';

	sub start_dtd {
		print "DTD handling called okay.\n";
	}
}

my $opt = $ARGV[0] || '';
my $end;
if ($opt eq "--writer") {
	require XML::SAX::Writer;
	$end = XML::SAX::Writer->new;
}
else {
	$end = Foo->new;
}
my $filter = XML::Filter::XSLT->new(Handler => $end);
$filter->set_stylesheet_uri("foo.xsl");
my $parser = XML::SAX::ParserFactory->parser(Handler => $filter);
$parser->parse_string("<a/>");
