#!/iw/perl/current/bin/perl # # file: chkxml # desc: do a quick validate/well-formedness check on XML docs # eval 'exec /iw/perl/current/bin/perl -s $0 ${1+"$@"}' if 0; BEGIN { my $iw_root = ($ENV{IW}) ? $ENV{IW} : "/iw"; my $edgar_root = "$iw_root/skulker/edgar/current"; # where we find our local libraries my($libdir) = "$edgar_root/lib"; if ( -d $libdir) { unshift(@INC, $libdir); } } # we want perl 5.00x or later require 5.004; # who am i? ($prog = $0) =~ s#.*/##; # XML parser support use XML::Parser; my($parser) = new XML::Parser; foreach $file (@ARGV) { my($doc) = eval { $parser->parsefile($file, ErrorContext => 3); }; print $@ if ($@); } exit 0;