[macruby] #108: Exception parsing XML file using REXML
#108: Exception parsing XML file using REXML ----------------------------------+----------------------------------------- Reporter: jon.lipsky@gmail.com | Owner: lsansonetti@apple.com Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Hi, I am getting a "Can't modify immutable string" exception when trying to parse an XML document using the streaming parser included with REXML. I have created a sample script and sample XML file to reproduce the problem: {{{ require "rexml/document" require "rexml/streamlistener" include REXML class Reader include StreamListener def tag_start(a_name, a_attributes) puts(a_name + " - " + a_attributes.to_s) end end reader = Reader.new file = File.open("test.xml",File::RDONLY) Document.parse_stream(file, reader) }}} {{{ <?xml version="1.0" encoding="UTF-8"?> <test> </test> }}} Here is the stack trace that is generated: {{{ /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/parsers/baseparser.rb:260:in `force_encoding': can't modify immutable string (RuntimeError) from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/parsers/baseparser.rb:260:in `pull' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/parsers/streamparser.rb:16:in `parse' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/document.rb:200:in `parse_stream' from /Development/personal/ruby/rbface/src/rb/rexml_test.rb:16:in `<main>' }}} Thanks and best regards, Jon... -- Ticket URL: <https://www.macruby.org/trac/ticket/108> macruby <http://macruby.org/>
#108: Exception parsing XML file using REXML ----------------------------------+----------------------------------------- Reporter: jon.lipsky@gmail.com | Owner: lsansonetti@apple.com Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.4 Component: MacRuby | Resolution: Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@apple.com): * milestone: => MacRuby 0.4 -- Ticket URL: <http://www.macruby.org/trac/ticket/108#comment:1> MacRuby <http://macruby.org/>
#108: Exception parsing XML file using REXML ----------------------------------+----------------------------------------- Reporter: jon.lipsky@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: MacRuby 0.4 => MacRuby 0.5 Comment: Seems to work all fine in trunk as of r2945: {{{ $ macruby t.rb test - {} }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/108#comment:2> MacRuby <http://macruby.org/>
participants (2)
-
macruby
-
MacRuby