From: William James Date: 2005-09-30T04:21:44+09:00 Subject: Re: REXML to extract only values from XML? christopher.mcmahon@gmail.com wrote: > Say I have an XML record like > > > > CHRIS > MCMAHON > > 111223333 > > > I'd like to extract each value of each tag (without regard to > hierarchy) and add it to an array: > > ["CHRIS","MCMAHON","111223333"] > > The REXML docs don't seem to address this. I've tried various > methods, but I can't seem to find the way to address only the contents > of each tag. Any suggestions would be welcome xml = " CHRIS MCMAHON 111223333 " p xml.split( / <.*?> (?: \s* <.*?> )* /xm )[1 .. -2] ---> [" CHRIS ", "MCMAHON", "111223333"]