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

Did you run the test suite for XML::Schematron and did it pass?
  • Comment on Re: Validating XML file with XML::Schematron::LibXSLT

Replies are listed 'Best First'.
Re^2: Validating XML file with XML::Schematron::LibXSLT
by hiruzen (Novice) on Jul 28, 2014 at 08:25 UTC
    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";
        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
Re^2: Validating XML file with XML::Schematron::LibXSLT
by hiruzen (Novice) on Jul 28, 2014 at 12:11 UTC
    No it does not pass! Please check this link