@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!/usr/bin/perl
#line 15
# 
# 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::Handler::YAWriter;
use IO::File;

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

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

	'Source' => { 'SystemId' => $ARGV[1] }
	)->parse();

0;
__END__

=head1 NAME

digest - command line interface to the Digest SAX Filter

=head1 SYNOPSIS

  digest scriptfile.xml some_original.xml > 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

__END__
:endofperl
