in reply to Re: Quick check for XML DTD or Schema.. XML::Twig solution
in thread Quick check for XML DTD or Schema

Thanks. I think I now can build the solution using XML::Twig
my $t= XML::Twig->new(load_DTD => 1,DTDHandler=>\&checkit )->parsefile +( "$xmlfile"); sub checkit { my ($twig, $dtd) = @_; my $root=$twig->root; my @text=$root->att_names; if (grep /schemaLocation/, @text) { print "found schema\n"; } else { if ($twig->{twig_doctype}) { print "found dtd\n"; } else { print "no dtd/schema defined\n" } } }

Replies are listed 'Best First'.
Re^3: Quick check for XML DTD or Schema.. XML::Twig solution
by Discipulus (Canon) on Nov 07, 2014 at 08:02 UTC
    Bravo!
    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.