Actions
Bug #13636
closedREXML::Document.parse_stream doesn't handle when closing tag not provided
Description
I've tried to use REXML for parsing but got unexpected behavior:
Here is example:
require 'rexml/document'
require 'rexml/streamlistener'
class Handler include REXML::StreamListener end
xml1 = StringIO.new("<body><item>test</item></body>")
xml2 = StringIO.new("<body><item>test</body>")
xml3 = StringIO.new("<body><item>test</item>")
handler = Handler.new
REXML::Document.parse_stream(xml1, handler) # => nil
REXML::Document.parse_stream(xml2, handler) # => REXML::ParseException: Missing end tag for 'item' (got "body")
REXML::Document.parse_stream(xml3, handler) # => nil
Actualy XML: "
test" is broken so it's expected to get:REXML::ParseException.new( "Missing end tag for body")
I can't rely on REXML parse since I'm not getting exception when XML data structure not valid.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0