From: Ruby Mania Date: 2011-11-24T20:49:41+09:00 Subject: Re: NOKIGIRI XPATH one way i can think of is to loop and break after getting first value its ok if one english tag what is multiple tag in the long file Ruby Mania wrote in post #1033514: > Thanks a lot for help. But it matched CDEF and all nodes after that even > if key != english > > thanks again > > >>> >> >> Try this: >> >> doc.xpath("//key[. = 'English']/following-sibling::topic/data") >> >> => [#> children=[#]>] >> >> >> Jesus. -- Posted via http://www.ruby-forum.com/.