Re: How to limit errors from XML::LibXML::Schema

"Martin J. Evans" <[email protected]> Thu, 16 Sep 2010 14:18:56 +0100
Newsgroups gmane.comp.lang.perl.xml
Organization Easysoft Limited
Message-ID <[email protected]>
On 13/09/10 23:06, Michael Ludwig wrote:
> Martin J. Evans schrieb am 13.09.2010 um 15:36 (+0100):
>> I'm using XML::LibXML::Schema to validate a document against a
>> schema. Malicious input of documents with lots of errors is
>> causing me a headache as the error string code obviously does some
>> recursion and I get:
>>
>> Deep recursion on subroutine "XML::LibXML::Error::as_string" at
>> /usr/local/lib/perl/5.10.0/XML/LibXML/Error.pm line 182
>>
>> Does anyone know if there is a way to limit the number of errors
>> found/reported or any other way of avoiding the deep recursion.
> 
> Don't know. You could give suppress_errors [1] a try, but I'm
> neither sure it is applicable for schema validation errors nor
> it works at all [2].
> 
> [1] perldoc XML::LibXML::Parser
> [2] https://rt.cpan.org/Public/Bug/Display.html?id=58024
> 

perl -MXML::LibXML -le 'my $h = XML::LibXML::Schema->new(string => q|<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"></xs:schema>|); $h->suppress_errors();'

Can't locate object method "suppress_errors" via package "XML::LibXML::Schema" at -e line 1.

Guess not. Thanks for the possible solution though.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs