From: SUTOU Kouhei Date: 2002-08-13T23:11:48+09:00 Subject: Re: Problem with REXML Hi, From: SUTOU Kouhei Subject: Re: Problem with REXML Date: Tue, 13 Aug 2002 13:27:57 +0900 Message-ID: <20020813.132754.104026301.kou@cneti.net> > REXML::XPath.each(doc,"//AUTHOR[../TITLE/text()='lala']") do |author| > puts author # This is "puts autor.text" if you want to get "hans". > end Another: doc.root.each_element("BOOK") do |book| puts book.get_text("AUTHOR").to_s if "lala" == book.get_text("TITLE").to_s end > REXML::XPath.each(doc,"//BOOK[TITLE/text()='lala']") do |book| > @element = book > end Another: doc.root.each_element("BOOK") do |book| @element = book if "lala" == book.get_text("TITLE").to_s end yours, ====================== SUTOU Kouhei kou@cneti.net