From: Brian Candler Date: 2011-02-07T06:08:05+09:00 Subject: Re: REXML - Empty string error Stuart Clarke wrote in post #979927: > Hi all, > > I am parsing some XML with XPATH and REXML. A snippet is below: > > .. > e.elements['Questions'].text << "," << > e.elements['Offers'].text << "," << > e.elements['ID'].text << "," << > .. > > The ID XML tag is often an empty tag (no data in it) and this throws an > error in my script of > > .rb:364:in `<<': can't convert nil into String (TypeError) > > How do I ignore this error? I just want to take whatever is in the XML > (even if it is empty) and carry on to the next data set. Very similar question asked (and answered) within the last day: http://www.ruby-forum.com/topic/1021053 -- Posted via http://www.ruby-forum.com/.