XML::Validator::Schema 1.08 review
DownloadXML::Validator::Schema is a Perl module to validate XML against a subset of W3C XML Schema. SYNOPSIS use XML::SAX::ParserFact
|
|
XML::Validator::Schema is a Perl module to validate XML against a subset of W3C XML Schema.
SYNOPSIS
use XML::SAX::ParserFactory;
use XML::Validator::Schema;
#
# create a new validator object, using foo.xsd
#
$validator = XML::Validator::Schema->new(file => 'foo.xsd');
#
# create a SAX parser and assign the validator as a Handler
#
$parser = XML::SAX::ParserFactory->parser(Handler => $validator);
#
# validate foo.xml against foo.xsd
#
eval { $parser->parse_uri('foo.xml') };
die "File failed validation: $@" if $@;
This module allows you to validate XML documents against a W3C XML Schema. This module does not implement the full W3C XML Schema recommendation (http://www.w3.org/XML/Schema), but a useful subset. See the SCHEMA SUPPORT section below.
IMPORTANT NOTE: To get line and column numbers in the error messages generated by this module you must install XML::Filter::ExceptionLocator and use XML::SAX::ExpatXS as your SAX parser. This module is much more useful if you can tell where your errors are, so using these modules is highly recommeded!
Requirements:
Perl
XML::Validator::Schema 1.08 keywords