I played around with nokogiri in ruby and the XML searching feature, e.g.:
a = Nokogiri.XML(open 'a.xml')
x = a.search('//div[@class="foo"]').text
which works quite nice.
But how can I specify to match the next (brother) element on the same level (and only the next)?
For example for this input:
<div>
<div>...</div>
<div>...</div>
<div class="foo"></div>
<div>EXTRACT ME</dev>
...
</div>
The actual input is some non-XHTML html, but so far Nokogiri.XML does not complain.
Btw, what filter syntax f.search actually expects? xpath?