NAME

oEdtk::XML::XSD - validate an XML file against an XSD schema

SYNOPSIS

use oEdtk::XML::XSD;

oEdtk::XML::XSD::parse_and_validate_xml_file_xsd($xml_file, $xsd_file);

DESCRIPTION

Thin wrapper over XML::LibXML::Schema. It dies when the document does not validate. Moved into the mainline from the 0.8032 fork at S21 of the fork-merge plan.

FUNCTIONS

parse_and_validate_xml_file_xsd

parse_and_validate_xml_file_xsd($xml_file, $xsd_schema);

Load $xml_file, validate it against the XSD schema $xsd_schema and return true. The function croaks with the validation errors, prefixed by the two file names, when the document is invalid. Note that XML::LibXML::Schema::validate returns a false value on success and dies on failure, which is what the check relies on; see t/int/35_xml_dtd_xsd.t.

AUTHOR

The oEdtk team.