http://qs321.pair.com?node_id=388124


in reply to Re: XML validating (no DTD)
in thread XML validating (no DTD)

Hi

I just found the solution on perlmonks, it is so easy:
use XML::Parser; my $p = XML::Parser->new; my $file = 'data.xml'; eval { $p->parsefile($file) }; if ($@) { print 'XML is not well formed'; } else { print 'XML is well formed'; }


Ofcoure, I can't validate XML, if I don't have DTD, I can check it if it is well formed, sorry for mistake.