NAME

Krang::XML::Validator - validate XML documents against XML Schemas


SYNOPSIS

  # create a new validator
  $validator = pkg('XML::Validator')->new();
  # validate a file
  ($ok, $msg) = $validator->validate(path => 'story1024.xml');
  # deal with results
  unless ($ok) {
    croak "That story just ain't right: $msg";
  }


DESCRIPTION

This module allows you to validate XML documents against schemas stored in $KRANG_ROOT/schema. The documents must contain schema declarations like this one in their root element:

  <index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="index.xsd">

The .xsd file specified for xsi:noNamespaceSchemaLocation must exist in $KRANG_ROOT/schema.


INTERFACE