From: Paul Lutus Date: 2006-10-06T04:20:20+09:00 Subject: Re: Parse and modify an XML file with REXML jeffnyman@gmail.com wrote: / ... > I know how to parse through XML using XPath or using a stream listener. > I have read the tutorial that comes with REXML. But what I'm not sure > how to do is check for the conditions like I described above. One > thought was I could read the XML into an array because then I get an > enforced "line numbering" with the indexing. So I could check > currentLine - 1 and currentLine + 1. I'm not sure if that is a smart > approach, however. Why not keep a running set of three records, and only test the middle record? That way, you can look ahead and behind one record before making a decision. -- Paul Lutus http://www.arachnoid.com