From: Eric Hodel Date: 2009-08-25T07:30:25+09:00 Subject: Re: REXML: parsing a string with unescaped ampersand entitie On Aug 24, 2009, at 15:18, Engine Yard wrote: > Did anyone actually find out a solution to this issue. > > I have an ActiveResource object which returns back some xml content > (as > a result of a web service call) with unescaped "& " and this causes > the > same issue. These two statements are contradictory. It can't both be XML and have unescaped &. > Wondering if we can customize the method call to > REXML::Text.initialize() and set raw=>false. > > Tried to change the setting in the REXML library that comes with the > Ruby distribution, but that did not help. > > Is there a way to overcome this issue without patching any of Ruby or > Rails code. I cannot change the content on the web service server. Use a parser that handles errors: $ ruby -rubygems -e 'require "nokogiri"; d = Nokogiri::XML "&"; p d.errors; p d' [#] $ PS: The name on your email account is odd.