#!/usr/bin/env perl

# Run with:   $0 <$xml-file>
# Example:  examples/show examples/dutch-sepa/camt.053.001.02.xml

use warnings;
use strict;

use lib 'lib';
use Business::CAMT  ();

use Log::Report; # mode => 'DEBUG';

@ARGV >= 1
	or error "Usage: $0 \$infile [\$outfile]";

my ($xml, $outfile) = @ARGV;
-r $xml or fault "XML file cannot be used";

my $camt = Business::CAMT->new(
#	big_numbers   => 1,
#	match_schema  => 'NEWEST',
	long_tagnames => 1,
);

my $data = $camt->read($xml);

print "** The content of the message.  Compare this with template to learn.\n";
print $data->toString;

print "** The data is a ". (ref $data) . " object.\n";

if($outfile)
{	print "** Writing the same data to file $outfile\n";
	$data->write($outfile);
}

exit 0;
