From: Ross Bamford Date: 2006-02-22T19:36:57+09:00 Subject: Re: [OT] Xpath to attributes On Wed, 2006-02-22 at 10:33 +0900, listrecv@gmail.com wrote: > Is there anyway to do generic xpath's, for both elements and attributes > (ie //customer/phone/@type --> "home")? REXML can do xpath to fetch > elements (rexml_element.text('//customer/phone')) but can't seem to use > xpath to find attributes. d = REXML::Document.new < 0115 07807 EOX m = REXML::XPath.match(d, '//customer/phone[@type = "home"]') p m.to_s # => 0115 -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk