#!/usr/bin/env perl
package XML::XSS::xss;
BEGIN {
$XML::XSS::xss::AUTHORITY = 'cpan:YANICK';
}
{
$XML::XSS::xss::VERSION = '0.3.4';
}
#ABSTRACT: command-line XML::XSS processor
use Getopt::Long;
GetOptions(
'script=s' => \my $script,
'm=s' => \my $module,
'stylesheet=s' => \my $stylesheet,
);
my $document = join '', <>;
my $xss;
if( $stylesheet ) {
my $class = "XML::XSS::Stylesheet::$stylesheet";
eval "use $class";
die $@ if $@;
$xss = $class->new;
}
elsif ( $script ) {
$xss = do $script;
}
elsif( $module ) {
eval "use $module";
$xss = $module->new;
}
print $xss->render( $document );
__END__
=pod
=head1 NAME
XML::XSS::xss - command-line XML::XSS processor
=head1 VERSION
version 0.3.4
=head1 SYNOPSIS
xss --stylesheet <stylesheet> document.xml
=head1 AUTHOR
Yanick Champoux <yanick@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut