From: Mark Thomas Date: 2010-02-13T05:15:08+09:00 Subject: Re: REXML translate (XPath?) On Feb 11, 7:42 pm, "Andrew C." wrote: > Can somebody explain or put me to an explanation of how to use > REXML::Functions::translate ? > > I'd like to turn this: group_list.elements["entry[title='#{name}']"] > > . . . into a case insensitive lookup.  Do I put the translation into > the XPath in that line?  Do I need a separate translation line? > > Thanks, > Andrew This would be the correct XPath: group_list.elements["entry[translate(title, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='#{name.downcase}']"] but I don't know if REXML can handle it, because it's not fully XPath compliant. I'd use an XPath-compliant parser like Nokogiri if this is an issue. -- Mark.