[ruby-trunk - Bug #8844][Open] Nested ParseError in rexml

Issue #8844 has been reported by ohai (Ippei Obayashi).


Bug #8844: Nested ParseError in rexml

Author: ohai (Ippei Obayashi)
Status: Open
Priority: Normal
Assignee:
Category: lib
Target version:
ruby -v: ruby 2.1.0dev (2013-08-31 trunk 42735) [x86_64-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

以下のように不正な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:
:
同じ情報が何度も表示され、冗長です。

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

Issue #8844 has been updated by kou (Kouhei S.).

Assignee set to kou (Kouhei S.)

ありがとうございます!
取り込みました!

パッチには別の問題の修正もあったのでそっちも取り込みました。

Bug #8844: Nested ParseError in rexml

Author: ohai (Ippei Obayashi)
Status: Closed
Priority: Normal
Assignee: kou (Kouhei S.)
Category: lib
Target version:
ruby -v: ruby 2.1.0dev (2013-08-31 trunk 42735) [x86_64-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

以下のように不正な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:
:
同じ情報が何度も表示され、冗長です。

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