From: Robert Klemme Date: 2008-04-25T06:10:11+09:00 Subject: Re: REXML cannot handle apostrophes? On 24.04.2008 02:17, Stedwick wrote: > I have this line in my XML file that was created by REXML > > > > And I simply cannot access that element using REXML, at all, in any > way, no matter what, as far as I can tell... I am not sure what you mean, it works for me: irb(main):003:0> s="" => "" irb(main):004:0> d = REXML::Document.new s => ... irb(main):005:0> d.elements => # ... > irb(main):006:0> d.elements.each {|e| p e} => [] irb(main):007:0> d.elements.each {|e| p e.attributes} {"name"=>name='03x08 - Future's End ~ 1', "rating"=>rating='100'} => [] irb(main):008:0> d.elements.each {|e| p e.attributes["name"]} "03x08 - Future's End ~ 1" => [] irb(main):009:0> d.elements.each {|e| p e.attributes["rating"]} "100" => [] > I have tried escaping the apostrophes, I have tried converting them to > ', I have tried both directly accessing the element and using > XPath, nothing works. As I said, at least direct access works for me. > Does anybody have any tricks for how to access elements that have > attributes with apostrophes in their names? Thanks! Kind regards robert