#!/usr/bin/perl -w
#
# Joshua "Jabra" Abraham
# Mon Aug 31 23:29:28 EDT 2009
#
# XML validation based on a DTD.
#
# Ex: ./validate_dtd.pl nikto.xml docs/nikto.dtd
#
use strict;
use XML::LibXML;
if (!defined($ARGV[0]) or !defined($ARGV[1]) ) {
	print "$0 [xml-file] [dtd-file]\n";
	exit;
}
my $xml_f = $ARGV[0];
my $dtd_f = $ARGV[1];
  
my $dtd = XML::LibXML::Dtd->new(
                        "$dtd_f",
                        "$dtd_f");
my $doc = XML::LibXML->new->parse_file("$xml_f");
$doc->validate($dtd);
