On Sep 29, 10:56    뮮 
> Is there any way to get any useful data out of REXML::ParseException > when you're working on a String? It never sets @position or @line or > anything. I need to figure out exactly where the error-causing tag > starts, and save it.
>
> Any ideas?

Out of curiosity, I tried libxml. It has nice error messages:

foo.xml:3:
parser error :
Opening and ending tag mismatch: title line 3 and txitle
        <title>Foo</txitle>
                           ^

but they go to stdout. You can capture them by registering an error
handler. Sample code:

parser = XML::Parser.new
parser.filename = "foo.xml"

msgs = []
XML::Parser.register_error_handler lambda { |msg| msgs << msg }

begin
  parser.parse
rescue Exception => e
  puts "Error: #{msgs}"
end

-- Mark.