From: Christian Neukirchen Date: 2005-09-06T00:58:02+09:00 Subject: Re: Encoding hell Joshua Haberman writes: > On Sep 5, 2005, at 8:25 AM, Zach Dennis wrote: > >> On Mon, 2005-09-05 at 22:34 +0900, Damphyr wrote: >> >>> >>> >>> <ISBNORG> >>> <RECORD> >>> <ISBN>0764558315</ISBN> >>> <AUTHOR>Rod Johnson, with Juergen Hoeller.</AUTHOR> >>> <FULLTITLE>Expert one-on-one J2EE development without EJB / Rod >>> Johnson, with Juergen Hoeller.</FULLTITLE> >>> >>> <SHORTTITLE>Expert one-on-one J2EE development without EJB >>> /</SHORTTITLE> >>> <EDITION></EDITION> >>> <PUBLISHER>Wiley Pub./Wrox,</PUBLISHER> >>> <DATE>c2004.</DATE> >>> <SUBJECT>Java (Computer program language)</SUBJECT> >>> >>> </RECORD> >>> </ISBNORG> >>> >>> > > Another way of looking at this: you're getting one XML document > embedded in another: > > enclosing_doc = REXML::Document.new(str) > real_doc = REXML::Document.new(enclosing_doc.elements["/string"].text) > This is the right way to tackle the problem. Don't unescape on your own, let the XML parser do it. Whoever created that webservice should be shot, by the way. Namespaces don't exist without a reason. > Josh -- Christian Neukirchen http://chneukirchen.org