#! /usr/local/bin/perl
#
# Script to validate the API documentation XML.
#
# Usage: validate-api.pl file2scan [...]
#

use Getopt::Long;
use HTML::Entities;
use XML::Xerces;
use XML::Xerces::DOMParse;

foreach $file (@ARGV) {
    my($parser, $doc);
    $parser = XML::Xerces::DOMParser->new();
    $parser->setValidationScheme($XML::Xerces::DOMParser::Val_Always);
    $parser->setErrorHandler(XML::Xerces::PerlErrorHandler->new());
    $parser->parse(XML::Xerces::LocalFileInputSource->new($file));
    print "$file parsed successfully.\n";
}
