{"action":"created","issue":{"url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1282","labels_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1282/labels{/name}","comments_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1282/comments","events_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1282/events","html_url":"https://github.com/sparklemotion/nokogiri/issues/1282","id":73715752,"number":1282,"title":"Nokogiri::XML::Schema#validate behaves differently in MRI and JRuby","user":{"login":"ylansegal","id":561180,"avatar_url":"https://avatars.githubusercontent.com/u/561180?v=3","gravatar_id":"","url":"https://api.github.com/users/ylansegal","html_url":"https://github.com/ylansegal","followers_url":"https://api.github.com/users/ylansegal/followers","following_url":"https://api.github.com/users/ylansegal/following{/other_user}","gists_url":"https://api.github.com/users/ylansegal/gists{/gist_id}","starred_url":"https://api.github.com/users/ylansegal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ylansegal/subscriptions","organizations_url":"https://api.github.com/users/ylansegal/orgs","repos_url":"https://api.github.com/users/ylansegal/repos","events_url":"https://api.github.com/users/ylansegal/events{/privacy}","received_events_url":"https://api.github.com/users/ylansegal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-06T19:36:38Z","updated_at":"2015-05-06T19:41:05Z","closed_at":null,"body":"When trying to re-use a `Nokogiri::XML::Schema` object for validating multiple `Nokogiri::XML` documents, the MRI and JRuby implementations behave differently. The JRuby implementation reports errors encountered in previous validation, while the MRI version does not. \r\n\r\nPlease see https://gist.github.com/ylansegal/eac88b27f5369b4f8ca7 for a recreation of the problem. It essentially validates a known good document, then a bad document and then a good document again against the same `Schema` object. In MRI, the last validation does not report errors (which is what I would expect). In JRuby it reports the errors from the previously validated document. \r\n\r\nBy the way, I encountered this error because the ruby-saml gem tries to memoize the schema to avoid reading from disk each time:\r\n\r\nhttps://github.com/onelogin/ruby-saml/blob/master/lib/onelogin/ruby-saml/saml_message.rb#L26 "},"comment":{"url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/comments/99583432","html_url":"https://github.com/sparklemotion/nokogiri/issues/1282#issuecomment-99583432","issue_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1282","id":99583432,"user":{"login":"flavorjones","id":8207,"avatar_url":"https://avatars.githubusercontent.com/u/8207?v=3","gravatar_id":"","url":"https://api.github.com/users/flavorjones","html_url":"https://github.com/flavorjones","followers_url":"https://api.github.com/users/flavorjones/followers","following_url":"https://api.github.com/users/flavorjones/following{/other_user}","gists_url":"https://api.github.com/users/flavorjones/gists{/gist_id}","starred_url":"https://api.github.com/users/flavorjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavorjones/subscriptions","organizations_url":"https://api.github.com/users/flavorjones/orgs","repos_url":"https://api.github.com/users/flavorjones/repos","events_url":"https://api.github.com/users/flavorjones/events{/privacy}","received_events_url":"https://api.github.com/users/flavorjones/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T19:41:05Z","updated_at":"2015-05-06T19:41:05Z","body":"Thanks for reporting this. Someone will take a look!\r\n"}}