in reply to Re: Validating XML file with XML::Schematron::LibXSLT
in thread Validating XML file with XML::Schematron::LibXSLT

Yes. It is passed with following code but with no error messages.
use XML::Schematron; my $pseudotron = XML::Schematron->new_with_traits( traits => ['LibXSLT +'], schema => "$schema_file"); my $messages = $pseudotron->verify($xml_file); print "$messages\n";

Replies are listed 'Best First'.
Re^3: Validating XML file with XML::Schematron::LibXSLT
by Anonymous Monk on Jul 28, 2014 at 09:20 UTC
      Thanks for pointing out. I really don't go though such testing before. I got following error for test case you mentioned:
      ok 1 - use XML::Schematron; ok 2 # skip XML::XPath not installed ok 3 - 'Schematron instance created' isa 'XML::Schematron' Could not create file parser context for file "t\data\order.scm": No s +uch file o r directory at C:/strawberry/perl/vendor/lib/XML/LibXML/SAX.pm line 10 +1. at C:/strawberry/perl/site/lib/XML/Schematron/Schema.pm line 44. # Tests were run but no plan was declared and done_testing() was not s +een. # Looks like your test exited with 2 just after 3.
      XML::XPath is not installed. I will install it and lets see what happens.

      Update:
      After installing XML::XPath and running same case again following error:
      ok 1 - use XML::Schematron; ok 2 - 'Schematron instance created' isa 'XML::Schematron' Cannot open file 't/data/order.xml' at C:/strawberry/perl/site/lib/XML +/XPath.pm line 53. # Tests were run but no plan was declared and done_testing() was not s +een. # Looks like your test exited with 2 just after 2.

      Update 2
      cpanm --test-only XML::Schematron::LibXSLT gives following output
      --> Working on XML::Schematron::LibXSLT Fetching http://www.cpan.org/authors/id/K/KH/KHAMPTON/XML-Schematron-1 +.09.tar.gz ... OK Configuring XML-Schematron-1.09 ... OK Building and testing XML-Schematron-1.09 ... OK Successfully tested XML-Schematron-1.09

        The test suite is run as part of the install process ... if you downloaded the .t file, its not much good to run it without the data files it references

        cpanm --test-only XML::Schematron::LibXSLT