in reply to Quick check for XML DTD or Schema
cat with_dtd.xml <?xml version="1.0"?> <!DOCTYPE p [ <!ELEMENT p ANY> ]> <p>Hello world!</p> perl -MXML::Twig -e "$twig= new XML::Twig(LoadDTD=>1,DTDHandler=>sub{p +rint qq(FOUND\n) if $_[1]});$twig->parsefile($ARGV[0])" with_dtd.xml #output.. FOUND cat withOUT_dtd.xml <?xml version="1.0"?> <p>Hello world!</p> perl -MXML::Twig -e "my $twig= new XML::Twig(LoadDTD=>1,DTDHandler=>su +b{print qq(FOUND\n) if $_[1]});$twig->parsefile($ARGV[0])" withOUT_dt +d.xml #output..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quick check for XML DTD or Schema.. XML::Twig solution
by ron800 (Novice) on Nov 06, 2014 at 20:25 UTC | |
by Discipulus (Canon) on Nov 07, 2014 at 08:02 UTC |