#!/usr/bin/perl
# 
# Copyright (c) 2001 Michael Koehne <kraehe@copyleft.de>
# 
# XML::Filter::Digest is free software. You can redistribute and/or modify
# this copy under terms of the GNU General Public License.

use strict;
use XML::Filter::Digest;
use XML::Driver::HTML;
use XML::Handler::YAWriter;
use IO::File;

my $digest = new XML::Filter::Digest(
    'Handler'=>
	new XML::Handler::YAWriter( 
	    'Output' => new IO::File( ">-" ),
	    'Pretty' => {
	        'PrettyWhiteNewline' => 1,
	        'PrettyWhiteIndent' => 1,
		'CatchEmptyElement' => 1
		}
	    ),

    'Script' =>
	new XML::Script::Digest(
	    'Source' => { 'SystemId' => $ARGV[0] }
	    )->parse(),
    );

my $html = new XML::Driver::HTML(
    'Handler' => $digest,
    'Source' => {
    	'SystemId' => $ARGV[1],
	'Encoding' => 'Latin1'
	}
    )->parse();

0;
__END__

=head1 NAME

survey - command line interface to the Digest SAX Filter

=head1 SYNOPSIS

  digest scriptfile.xml some_original.html > some_processed.xml

=head1 DESCRIPTION

XML::Filter::Digest is a PerlSAX Filter. The digest script provides
a shell interface that could be used with this tool for testing
Digest scripts or to embed them in other languages.

=head1 OPTIONS

  Currently no options ;-(

I think that the set of options used in YAWriter is a good start,
let's look what we need in addition for processing batches.

=head1 AUTHOR

  Michael Koehne, Kraehe@Copyleft.De
  (c) 2001 GNU General Public License

=head1 SEE ALSO

L<XML::Parser::PerlSAX> and L<XML::Filter::Digest>

=cut
