I want to verify XML file using XML::Schematron::LibXSLT here is code i tried which uses .sch schemafile and XML file as argument
use XML::Schematron::LibXSLT;
my $schema_file = $ARGV[0];
my $xml_file = $ARGV[1];
die "Usage: perl schematron.pl schemafile XMLfile.\n"
unless defined $schema_file and defined $xml_file;
my $tron = XML::Schematron::LibXSLT->new();
$tron->schema($schema_file);
my $ret = $tron->verify($xml_file);
print $ret . "\n";
It is giving error Can't locate object method "new" via package "XML::Schematron::LibXSLT" at schematron.pl line 14. which tell module don't have new method. May be module is updated.
use XML::Schematron;
my $pseudotron = XML::Schematron->new_with_traits( traits => ['LibXSLT
+'], schema => "$schema_file");
my $messages = $pseudotron->verify($xml_file);
print "$messages\n";
But it dosen't print anything. Don't know what is wrong!
Also at https://metacpan.org/pod/XML::Schematron::LibXSLT Synopsis, 2nd and 3rd use are giving same error.
The same problem is also posted on stackoverflow.com at
StackOverflow