From: "Thomas, Mark - BLS CTR" Date: 2006-08-03T02:20:25+09:00 Subject: Re: REXML XPath: bug or misunderstanding? 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 Are you doing anything with tbl other than making it a stopping point for iteration? 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. - Mark.