From: Peter Vandenabeele Date: 2012-01-10T18:15:09+09:00 Subject: Re: xml to html display --bcaec519618981c45e04b628f32d Content-Type: text/plain; charset=UTF-8 On Tue, Jan 10, 2012 at 12:55 AM, dabba dabba wrote: > Hi all, > > I need to parse following xml docs in a table where i can display it in > html like (table type format) > > > > > > > > > > > > > > > ............ > > > Output like this in HTML - > > > col1 col2 col3 > - choose - > | > - -when test="$map/xyz" - > data > | > $ab/abc ---------------------------------------------->|-ABC > $bp/fff ---------------------------------------------->|-PQR > > > > I don't expect there is a existing library/class that will do that but > any suggestions what will be the best approach to do this ... > > If there is some existing lib that does close to his , that will > obviously be great. > I suggest you look into Nokogiri.org Something I just tried: 1.9.3p0 :001 > require 'nokogiri' => true 1.9.3p0 :037 > s = < 1.9.3p0 :039"> 1.9.3p0 :040"> 1.9.3p0 :041"> 1.9.3p0 :042"> 1.9.3p0 :043"> 1.9.3p0 :044"> 1.9.3p0 :045"> 1.9.3p0 :046"> 1.9.3p0 :047"> 1.9.3p0 :048"> 1.9.3p0 :049"> 1.9.3p0 :050"> 1.9.3p0 :051"> ............ 1.9.3p0 :052"> 1.9.3p0 :053"> EXAMPLE ... 1.9.3p0 :055 > n = Nokogiri.XML(s) ... 1.9.3p0 :057 > n.children HTH, Peter -- Peter Vandenabeele http://twitter.com/peter_v http://rails.vandenabeele.com --bcaec519618981c45e04b628f32d--