#!/usr/bin/perl

# turn on perl's safety features

use strict;
use warnings;

use lib '.';

# load machines, including the Pipeline functiion

use XML::SAX::Machines qw(:all);
use XML::Handler::AxPoint;
use Getopt::Std;

use vars qw($opt_p);
getopts('p');

# set up a xml pipeline to run the xml though

my $machine = Pipeline(
 "XML::Filter::Transition",                       # first through our code
 XML::Handler::AxPoint->new(PrintMode => $opt_p), # then though axpoint, out to STDOUT
# \*STDOUT,
);

# check we got the correct command line arguments

die "didn't specify a xml file to parse" unless @ARGV;

# parse the url (probably just the file) we were
# passed on the command line

$machine->parse_uri($ARGV[0]);
