From: Mike Dalessio Date: 2010-01-12T22:56:40+09:00 Subject: Re: XML Manipulating --001485394142cfdb63047cf8050f Content-Type: text/plain; charset=ISO-8859-1 Hi Anandh, I've cross-posted my reply to nokogiri-talk, which is where followup questions are probably best sent. On Tue, Jan 12, 2010 at 6:44 AM, Anandh Kumar wrote: > Hi everybody > > Can anybody there help me in solving the following issue. > > Consider the XML > > > Business Strategy > bus1 > > > Company Description > tar1 > > > Business Strategy > bus2 > > > Company Description > tar2 > > > Business Strategy > bus3 > > > Company Description > tar3 > > > Can this xml be parsed and manipulated in ruby as > > > Business Strategy > bus1 > bus2 > bus3 > > > Company Description > tar1 > tar2 > tar3 > > > Any help would be greatly appreciated. > > > This is straightforward if you know some XPath (see http://www.w3.org/TR/xpath) and Nokogiri. I've posted a solution at: http://gist.github.com/275209 The general idea is that we find the nodes we care about, and then build a new document with those contents. Cheers, -mike --001485394142cfdb63047cf8050f--