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" } } }
In reply to Re^2: Quick check for XML DTD or Schema.. XML::Twig solution
by ron800
in thread Quick check for XML DTD or Schema
by ron800
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |