# frozen_string_literal: false
require "rexml/streamlistener"
class REXMLParser < BaseParser
REXML::Document.parse_stream(@rss, @listener)
raise NotWellFormedError.new{e.message}
rescue REXML::ParseException => e
line = context[0] if context
raise NotWellFormedError.new(line){e.message}
class REXMLListener < BaseListener
include REXML::StreamListener
def raise_for_undefined_entity?
def xmldecl(version, encoding, standalone)
super(version, encoding, standalone == "yes")
# Encoding is converted to UTF-8 when REXML parse XML.
alias_method(:cdata, :text)