From: Kouhei Sutou Date: 2012-02-02T21:50:54+09:00 Subject: [ruby-dev:45181] [ruby-trunk - Bug #5956][Closed] rexml - パース時のnamespaceチェックでのエラーについて Issue #5956 has been updated by Kouhei Sutou. Status changed from Assigned to Closed % Done changed from 0 to 100 r34419 で修正しました! 再現コードがあってとても助かりました! ありがとうございます! ---------------------------------------- Bug #5956: rexml - パース時のnamespaceチェックでのエラーについて https://bugs.ruby-lang.org/issues/5956 Author: Miho Hiramatsu Status: Closed Priority: Normal Assignee: Kouhei Sutou Category: lib Target version: 1.9.3 ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux] 添付のプログラムを実行すると以下のエラーとなります。 (実行環境:CentOS6) The 'xml' prefix must not be bound to any other namespace (http://www.w3.org/TR/REC-xml-names/#ns-decl) Line: 7 Position: 477 XMLデータ内の以下の記述に対して、 xmlns:xml="http://www.w3.org/XML/1998/namespace" 「属性"xmlns:xml"のnamespaceが"http://www.w3.org/XML/1998/namespace"でなければエラーとする」というチェックを /rexml/parsers/baseparser.rb line:386付近 で実行しているようですが、以下は誤りではないでしょうか。 [baseparser.rbのline:386付近を抜粋]    ...略 attrs.each { |a,b,c,d,e| if b == "xmlns" if c == "xml" if d != "http://www.w3.org/XML/1998/namespace" msg = "The 'xml' prefix must not be bound to any other namespace "+ "(http://www.w3.org/TR/REC-xml-names/#ns-decl)" raise REXML::ParseException.new( msg, @source, self ) end    ...略 if d != "http://www.w3.org/XML/1998/namespace" 本来"d"ではなく"e"と比較すべきではないでしょうか。 -- http://bugs.ruby-lang.org/