From: "mame (Yusuke Endoh)" Date: 2013-12-22T08:44:42+09:00 Subject: [ruby-core:59259] [ruby-trunk - Bug #9277] REXML fails to parse comments with multiple dashes ('-') in them Issue #9277 has been updated by mame (Yusuke Endoh). As I recall correctly, the XML spec does not allow "--" in a comment. http://en.wikipedia.org/wiki/XML#Comments > The string "--" (double-hyphen) is not allowed inside comments -- Yusuke Endoh ---------------------------------------- Bug #9277: REXML fails to parse comments with multiple dashes ('-') in them https://bugs.ruby-lang.org/issues/9277#change-43813 Author: bhollis (Ben Hollis) Status: Assigned Priority: Normal Assignee: kou (Kouhei Sutou) Category: lib Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN =begin REXML cannot handle multiple dashes in a comment: require 'rexml/document' REXML::Document.new('') =end =begin REXML::ParseException: # /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:351:in `pull_event' /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:183:in `pull' /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/parsers/treeparser.rb:22:in `parse' /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/document.rb:283:in `build' /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/document.rb:43:in `initialize' ... Malformed comment Line: 1 Position: 24 Last 80 unconsumed characters: Line: 1 Position: 24 Last 80 unconsumed characters: from /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/parsers/treeparser.rb:95:in `rescue in parse' from /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/parsers/treeparser.rb:20:in `parse' from /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/document.rb:283:in `build' from /Users/foo/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rexml/document.rb:43:in `initialize' =end -- http://bugs.ruby-lang.org/