From cfis at savagexi.com Sun May 3 21:13:07 2009 From: cfis at savagexi.com (Charlie Savage) Date: Sun, 03 May 2009 19:13:07 -0600 Subject: [libxml-devel] Frequent crashes of libxml-ruby with Ruby 1.9.1 In-Reply-To: References: Message-ID: <49FE4123.60706@savagexi.com> Rolf, > Currently we're building a Rails application that uses libxml-ruby > (1.1.3) to parse some documents and loop over its contents with xpath > expressions. > > When running the application with Ruby 1.8.7-p72, everything works > flawlessly. With Ruby 1.9.1-p0, however, we get frequent double-linked > list errors, like the one below. > > Is this is a known issue? If not, some pointers that may help us isolate > the issue would be very welcome. Thank you! Do you by chance have a test case? Charlie -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3237 bytes Desc: S/MIME Cryptographic Signature URL: From alecjacobson at gmail.com Fri May 1 10:47:08 2009 From: alecjacobson at gmail.com (Alec Jacobson) Date: Fri, 1 May 2009 10:47:08 -0400 Subject: [libxml-devel] Typos in rdoc... Message-ID: <86944d0905010747u4dc99591v458b6c533a93b6dc@mail.gmail.com> In the rdoc for ?Class?LibXML::XML::Reader, in the first example the code reads: parser = XML::Reader.string("123") reader.read Should that instead be: reader = XML::Reader.string("123") reader.read Thanks, also the word "contrast" is spelt "contract" in the rdoc for Class LibXML::XML::Parser in the first sentence. -Alec Jacobson alecjacobson.com From sam.mulube at gmail.com Mon May 4 06:14:12 2009 From: sam.mulube at gmail.com (sam mulube) Date: Mon, 4 May 2009 11:14:12 +0100 Subject: [libxml-devel] Can't seem to supress warning and errors In-Reply-To: References: Message-ID: Hi Alex, I puzzled about this for a while. Eventually I found this in the docs for XML::Error (http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/Error.html) > By default, warnings, errors and fatal errors that libxml generates are printed to STDERR via the XML::Error::VERBOSE_HANDLER proc. > To disable this output you can install the quiet handler: > XML::Error.set_handler(&XML::Error::QUIET_HANDLER) > Install your own handler: > XML::Error.set_handler do |error| > puts error.to_s > end > Or remove all handlers: > XML::Error.reset_handler So we've been using something a bit like the second method mentioned above as we are trying to capture some sort of informative error message about what went wrong with the parsing to return the user. Think there are some more examples in the test class for the error handler (tc_error.rb) if you have a look at the source. regards sam 2009/4/23 Alex Wayne > I am parsing a whole of imperfectly formed HTML. In doing so, about > 1600 errors are generated and dumped to the log/console every time I > parse this feed. Yet it parses fine with the recover option. But the > options for supressing the messages don't appear to work. > > Here's my code: > > parser = LibXML::XML::HTMLParser.string(Downloader.get > (url).clean_html, > :options => LibXML::XML::HTMLParser::Options::RECOVER | > LibXML::XML::HTMLParser::Options::NOERROR | > LibXML::XML::HTMLParser::Options::NOWARNING) > page = parser.parse.root > > > Is this the right way to declare the options for supressing errors and > warnings? Why aren't they actually supressed. I would worry too much > about this normally, but it appears after some profiling it appears > printing and handling these errors takes about 20-40% of my total > request time in my rails app, so its a fairly large performance issue. > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.timmermans at voormedia.com Thu May 7 08:20:18 2009 From: r.timmermans at voormedia.com (Rolf Timmermans) Date: Thu, 7 May 2009 14:20:18 +0200 Subject: [libxml-devel] Frequent crashes of libxml-ruby with Ruby 1.9.1 In-Reply-To: <49FE4123.60706@savagexi.com> References: <49FE4123.60706@savagexi.com> Message-ID: Hi Charlie, Unfortunately the errors do not occur in our test environment. It seems to happen during garbage collection, but so far have not been able to set up a test case that reproduces it. Kind regards, Rolf Timmermans On 4 mei 2009, at 03:13, Charlie Savage wrote: > Rolf, > >> Currently we're building a Rails application that uses libxml-ruby >> (1.1.3) to parse some documents and loop over its contents with >> xpath expressions. >> When running the application with Ruby 1.8.7-p72, everything works >> flawlessly. With Ruby 1.9.1-p0, however, we get frequent double- >> linked list errors, like the one below. >> Is this is a known issue? If not, some pointers that may help us >> isolate the issue would be very welcome. Thank you! > > Do you by chance have a test case? > > Charlie From havanap at gmail.com Thu May 7 22:37:33 2009 From: havanap at gmail.com (Norihito YAMAKAWA) Date: Fri, 8 May 2009 11:37:33 +0900 Subject: [libxml-devel] Formatting Schema Validation Errors In-Reply-To: <5eb98a9b0905070313u245f2e11w330643ec2fb7a1e6@mail.gmail.com> References: <5eb98a9b0905070313u245f2e11w330643ec2fb7a1e6@mail.gmail.com> Message-ID: <8154f7ea0905071937r1cdabc76h3d9240aa97ca889f@mail.gmail.com> Hi. You can obtain more "native" errors by LibXML::XML::Error#set_error_handler. It capture all errors of libxml, such as parsing, schema validations, etc. XML::Error object has error level, domain, occurred node and more informations. Means of the constants are not documented in ruby-libxml rdoc, so you may see libxml C API. http://www.xmlsoft.org/html/libxml-xmlerror.html#xmlError 2009/5/7 Sudhindra Kulkarni : > Hi, > > I have a schema validation site where given and xml schema validation is > performed. The output shown by the libxml is not well formatted is there a > way to neatly format the output by overriding a class method of libxml? or > something like that? > > Regards, > Sudhindra > > > _______________________________________________ > libxml-devel mailing list > libxml-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel >