[libxml-devel] XML::Error patch for Merb app.
Norihito YAMAKAWA
havanap at gmail.com
Thu Feb 19 08:57:31 EST 2009
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libxml-ruby-0.9.8.error_handler.patch
Type: application/octet-stream
Size: 2185 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/libxml-devel/attachments/20090219/665157b3/attachment-0001.obj>
More information about the libxml-devel
mailing list