in reply to XML Validation
my $validator = XML::LibXML->new(); $validator->validation(1); #test if the XML is well formed: my $doc; eval { $doc = $validator->parse_string($theXML); }; if ($@) { # it's not well formed, your error handling code here... } #test if the XML conforms to the DTD: eval { $doc->validate(); }; if ($@) { # it doesn't conform, your error code handling here... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: XML Validation
by Stegalex (Chaplain) on Apr 03, 2002 at 17:49 UTC |