Project

General

Profile

Actions

Bug #8844

closed

Nested ParseError in rexml

Added by ohai (Ippei Obayashi) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-08-31 trunk 42735) [x86_64-linux]
[ruby-dev:47672]

Description

以下のように不正なXMLをパースすると
require 'rexml/document'
REXML::Document.new("foo")
例外が発生し、以下のようなメッセージが表示されます(完全なものは添付したparseerror.txt)。
/home/ohai/.rbenv/versions/trunk-modified/lib/ruby/2.1.0/rexml/parsers/treeparser.rb:95:
in `rescue in parse': #<REXML::ParseException: Missing end tag for 'a' (got "b") (REXML:
:ParseException)
Line: 1
Position: 10
Last 80 unconsumed characters:

 :

nested_parseerror.rb:3:in `'
...
Missing end tag for 'a' (got "b")
Line: 1
Position: 10
Last 80 unconsumed characters:

Line: 1
Position: 10
Last 80 unconsumed characters:
:
同じ情報が何度も表示され、冗長です。

添付したパッチのように変更すればこの繰り返しはなくなるのですがどうでしょうか。


Files

parseerror.txt (1.29 KB) parseerror.txt ohai (Ippei Obayashi), 08/31/2013 01:29 PM
rexml-nested-parseerror.diff (1.01 KB) rexml-nested-parseerror.diff ohai (Ippei Obayashi), 08/31/2013 01:29 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0