XML::Jing - Validate XML files using an RNG schema using the Jing tool
version 0.04
use XML::Jing; my $jing = XML::Jing->new('path/to/rng','use compact RNG'); my $error = $jing->validate('path/to/xml'); if(!$error){ print 'no errors!'; }else{ print $error; }
This module is a simple interface to Jing which allows checking XML files for validity using an RNG file.
new
Arguments: the path to the RNG file to use in validation, and a boolean indicating whether or not the given RNG file uses compact syntax (false means XML syntax)
Creates a new instance of XML::Jing.
XML::Jing
validate
Argument: path to the XML file to validate
Returns: The first error found in the document, or undef if no errors were found.
undef
Jing has more functionality and options than what I have interfaced with here.
Also, it would be nice to be able to get ALL of the errors in an XML file, instead of jut the first one.
Jing homepage: http://www.thaiopensource.com/relaxng/jing.html
Inline::Java was used to interface with Jing: Inline::Java
Nathan Glenn <garfieldnate@gmail.com>
This software is copyright (c) 2013 by BYU Translation Research Group.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install XML::Jing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Jing
CPAN shell
perl -MCPAN -e shell install XML::Jing
For more information on module installation, please visit the detailed CPAN module installation guide.