From: David Sainte-claire Date: 2009-12-01T03:19:02+09:00 Subject: Odd puts behaviour with REXML Hello, This is really weird, and I'm not sure if maybe there's a formatting option that I can set on the puts method that will solve it. Hopefully someone has done something similar?? I have been using REXML to parse through an XML document that I get back from calling a ReST-ish web service, and up until now it has parsed every single element as I'd expect. But I run into this small patch of data were it acts weird. The XML looks like this: eSupport Find related product support and help in http://www.somecompany.com/US/perl/model-home.pl?XID=M:products:crmportal&LOC=3&mdl=someModel And I'm parsing it like this: data.elements.each("product/profile/support"){|element| element.elements.each() do |child| puts "Did XPATH match any profile elements?" puts child.text end } I know it's pretty rudimentary, but I'm just confused as to why this same pattern has been able to get text out of every other element I have searched for, but here I get something like this when I loop through the subelemenents: Did XPATH match any profile elements? ???Product_Support_Link_Title??? Did XPATH match any profile elements? ???Product_Support_Link_Prefix??? Did XPATH match any profile elements? ???Product_Support_Link???&mdl=someModel It looks like XPATH doesn't like the format of the text somehow, but I have no idea what it is about it that it doesn't like since it appears to be just normal text to me. Anyone have any ideas? It looks like something that REXML is doing since it outputs the path to the element in the document Product --> Support but I don't have a clue where the _Link is coming from? Thanks in advance for all your help! David -- Posted via http://www.ruby-forum.com/.