# Issue with libxml validation block

**URL:** <https://www.ruby-forum.com/t/issue-with-libxml-validation-block/186244>\
**Category:** Rails\
**Created:** [April 2, 2010, 10:54pm UTC](https://www.ruby-forum.com/t/issue-with-libxml-validation-block/186244 "2010-04-02T22:54:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClSSSSment\_LAGRANGE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@ClSSSSment\_LAGRANGE](https://www.ruby-forum.com/u/ClSSSSment_LAGRANGE)\
**Post date:** [April 2, 2010, 10:54pm UTC](https://www.ruby-forum.com/t/issue-with-libxml-validation-block/186244/1 "2010-04-02T22:54:07Z")

</div>

Hello,  
I have a weird issue with the ruby Libxml2 ruby bindings in a Rails  
project.  
I use the validate\_schema method, with a block which should be called  
on each validation error.  
The problem is that this block is not always triggered :  
specifically, it works with the Webbrick server, but NOT with the  
console script, or the thin (which use rack) webserver…  
Of course I use exactly the same document and schema.  
I’ve tried development and production environments with no change !  
Also another difference between Webbrick and Console/Thin, is with the  
error handler.  
With Console/Thin, &LibXML::XML::Error::VERBOSE\_HANDLER is used, since  
the error is printed.  
However with webbrick nothing is outputted so either there is no  
handler, or it’s QUIET\_HANDLER  
If you need more details than that, please ask…  
Also if you feel it’s not a Rails’ problem, please tell me where I can  
go !

I tried to check how the gems are loaded in each case, to see any  
differences, but I couldn’t figure out how it works !

In environment.rb  
config.gem “libxml-ruby”, :lib =\> ‘xml’, :version =\> “=1.1.3”

Archlinux :  
libxml2 2.7.7-1

Gem  
rails (2.3.5)  
thin (1.2.7)  
rubygems-update (1.3.6, 1.3.5)  
rack (1.1.0, 1.0.1)

Regards,

---

<div class="post-metadata">

**Author:** ![ClSSSSment\_LAGRANGE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@ClSSSSment\_LAGRANGE](https://www.ruby-forum.com/u/ClSSSSment_LAGRANGE)\
**Post date:** [April 6, 2010, 5:19pm UTC](https://www.ruby-forum.com/t/issue-with-libxml-validation-block/186244/2 "2010-04-06T17:19:34Z")

</div>

A quick note to add that I don’t think it’s a libxml issue !  
If you have any insight of the require process of Rails, more  
specifically differences between WebBrick and Console in requiring  
gems, I’d be glad to hear about it…  
Regards,

2010/4/2 Clément LAGRANGE [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
