rekoil has asked for the wisdom of the Perl Monks concerning the following question:
What happens is that once the second file is loaded, the checker reports DTD errors that make it look like it still thinks I'm reading in a single file:my $checker = new XML::Checker::Parser(Handlers => {}); foreach ($files) { print "Checking file $_ ...\n"; eval { $checker->parsefile($_); }; if ($@) { (print $error) } }
I can get around this by putting the my $checker = new XML::Parser::Checker ... line inside the foreach loop, but that seems terribly inelegant to me. Is there a better way to do this? Is there a method in XML::Checker::Parser I'm not seeing to tell it to expect a new complete XML file?Checking file file1.xml ... Checking file file2.xml ... (115, ELEMENT [foo] already defined Element foo line 2 column 67 byte +90) Checking file file3.xml ... (115, ELEMENT [foo] already defined Element foo line 2 column 67 byte +90) ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Checker::Parser - one object, multiple files?
by Fletch (Bishop) on Jan 22, 2008 at 02:07 UTC | |
|
Re: XML::Checker::Parser - one object, multiple files?
by Cody Pendant (Prior) on Jan 22, 2008 at 03:41 UTC |