You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the output from the following script is different on JRuby and MRI.
#!/usr/bin/env ruby
require 'nokogiri'
class Doc < Nokogiri::XML::SAX::Document
attr_reader :errors
def error error
(@errors ||= []) << error
super
end
end
parser = Nokogiri::XML::SAX::PushParser.new(Doc.new)
parser.finish
puts parser.document.errors.inspect
on MRI
/home/jvshahid/codez/nokogiri/lib/nokogiri/xml/sax/push_parser.rb:47:in `native_write': 1:1: FATAL: Extra content at the end of the document (Nokogiri::XML::SyntaxError)
from /home/jvshahid/codez/nokogiri/lib/nokogiri/xml/sax/push_parser.rb:47:in `write'
from /home/jvshahid/codez/nokogiri/lib/nokogiri/xml/sax/push_parser.rb:55:in `finish'
@jvshahid I looked at the libxml2 implementation here (xmlParseChunk) and there isn't any way to affect that behavior. We could count how many bytes we've seen and if 0 then suppress that particular error from xmlParseChunk ... but that seems like a lot of work for an edge case. I'm wondering what you think an alternative solution might look like?
What problems are you experiencing?
the output from the following script is different on JRuby and MRI.
on MRI
on JRuby
What's the output from
nokogiri -v
?Below is the output for JRuby and MRI
Can you provide a self-contained script that reproduces what you're seeing?
provided above
The text was updated successfully, but these errors were encountered: