Hi.

When I was writing Merb app which does XML Schema validation with
LibXML 2.7.3, global error handler registerd on XML::Error is never
callbacked even if  validation was failed.
I tried to add a code which re-register error handler to  Libxml
whenever XML::Error.set_handler is called.
It seems works well, error handler can be callbacked.

This is strange sinse simple XML Schema validation script works no
problem on global error callback, but inside Merb app, this trouble
occured...
It may be  multi-thread issue which Merb framework works as. (Of
course I use Mutex to synchronize libxml  access.)

At first, I was tried to use block with XML::Document#validate_schema,
but callback was never invoked when validation was failed. I spent a
half of day to fix it with involiving LibXML C-APIs, but I couldn't, I
decided to use global XML error handler.
Trouble with the block for validate_schema is occured even  minimum
test script, so I gave it up.

Also I found XML::Error#domain_to_s doesn't  work, this patch includes
additional constants for XML::Error.

Attachment: libxml-ruby-0.9.8.error_handler.patch
Description: Binary data

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to