Project

General

Profile

Actions

Bug #8701

closed

REXML bug in parsing notation declarations

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-07-28 trunk 42214) [x86_64-linux]
[ruby-dev:47551]

Description

添付したコード(test_notationdecl.rb)を実行すると、["x", "y", "z"] が表示することが期待されますが、["y", "z"] と表示されます。

パースに使っている正規表現の問題で, 添付したパッチ(rexml-dtd-notationdecl-fix.patch)で直ると思います。
テストも添付しています。

このパーサではあちこちで ^ で始まる正規表現が使われていますが、おそらくすべて \A のつもりであろうと思われます。添付したパッチでは関係のある部分だけ修正していますが、他の正規表現も修正したほうが良いかもしれません。


Files

test_notationdecl.rb (267 Bytes) test_notationdecl.rb ohai (Ippei Obayashi), 07/28/2013 11:20 PM
rexml-dtd-notationdecl-fix.patch (787 Bytes) rexml-dtd-notationdecl-fix.patch ohai (Ippei Obayashi), 07/28/2013 11:20 PM
rexml-dtd-notationdecl-test.patch (923 Bytes) rexml-dtd-notationdecl-test.patch ohai (Ippei Obayashi), 07/28/2013 11:20 PM
Actions #1

Updated by kou (Kouhei Sutou) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42482.
Ippei, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::PUBLIC):
    Fix loose "head" match regular expression.
    [Bug #8701] [ruby-dev:47551]
    Patch by Ippei Obayashi. Thanks!!!
  • test/rexml/parse/test_notation_declaration.rb (#test_system_public):
    Add a test for the above case.

Updated by kou (Kouhei Sutou) over 10 years ago

ありがとうございます!

既存のテストを整理してから取り込んだので遅くなってしまいました。

DOCTYPEの中のやつは全部\Aを意図していそうだったのでそうしました。DOCTYPEの外のやつはパッと見だと判断がつかなかったのでまだそのままにしてあります。

Actions

Also available in: Atom PDF

Like0
Like0Like0