Eric Armstrong wrote: > Thomas, Mark - BLS CTR wrote: >> Eric Armstrong wrote: >>> This code looks for a table that matches specific criteria: >>> >>> XPath.each(@doc, '//table') do |tbl| >>> XPath.each(tbl, '//td') do |td| >>> # look for matching data >> >> You could remove one loop if you simply delve to >> precisely what you're looking for: >> >> XPath.each(@doc, '//table//td') do |td| >> # look for matching data >> >> And, depending on how you define "matching data" you may be able to add >> some XPath conditions that get rid of the loop entirely. >> > Most excellent. Some damn good Xpath expertise > on this list. Thanks, all. > > eric > (Who hasn't used Xpath expressions in more than 3 years, > and who is entirely capable of forgetting everything he > ever knew in less than 6 months.) > :_) Same here: I rarely use XPath and I always have to look up the details again. IMHO it's not very intuitive. My 0.02EUR... Btw, I find http://www.xmlcooktop.com/ a handy tool for experimenting with XPath expressions. It's an XML editor with an XPath evaluation window where you can immediately see results. Nothing too fancy but I liked the XPath direct evaluation. Kind regards robert