Hi , This is prashanth <!DOCTYPE html PUBLIC ''-//W3C//DTD XHTML 1.0 Transitional//EN'' '' http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'' [ <!ENTITY nbsp '' ''> ]><see> <span class="mw-headline">Red Fort</span><li> <b>Chatta Chowk</b> (Covered Bazaar) – True to the name, this is a covered bazaar between the gate and the fort itself, now filled with souvenir hawkers. </li><li> <b>Diwan-i-Am</b> (Hall of Public Audience) – This building separates the outer court from the inner court, and has a marble platform for the emperor''s throne. </li><li> <b>Hayat Baksh Bagh</b> (Life-Bestowing Gardens) – Once a grand garden of full of fountains and streams, now sadly all dry — only dry channels and acres of green grass remain. </li><li> <b>Diwan-i-Khas</b> (Hall of Private Audience) – Built completely of marble, this is where the emperor received special visitors. </li><li> <b>Khas Mahal</b> (Private Palace) – The Emperor''s main residence. The octagonal <b>Mussaman Burj</b> tower looks out toward the Yamuna River, and is where the Emperor used to appear before the public for each morning. </li><li> <b>Rang Mahal</b> (Colour Palace) – The residence of the Sultan''s main wife. </li><li> <b>Mumtaz Mahal</b> (Jewel Palace) – Contained six apartments for the Sultan''s harem. Now used as a museum of court textiles, carpets, weapons, etc (free). </li><li> <b>Daawat Khana</b>. A minor palace at the northmost end of the Fort, this was originally the residence of a prince, but it was converted into a tea house by the British, a function it continues today. Basic meals go for around 60 rupees, drinks 10-20 rupees, and it also has the cleanest toilets around. </li><li> <b>Swatantra Sangrama Sangrahalaya</b> (Museum of the Independence Movement) – To the left after the Chatta Chowk, this is a reasonably well-presented museum on the history of independence activism in India, starting from the Mutiny of 1857 all the way to Gandhi. </li> </see> I got an html format by hpricot and its search method i wanna covert to xml format i mean i able to got inner_text between span that is in case <span class="mw-headline">Red Fort</span> Red Fort got and taken in temp variable as t1 and between <b>Chatta Chowk</b> taken as t2 and between <li>....</li> as t3 So i pulling text from html so i wanna convert to xml format the format is <See> <LandMarkType>Red Fort<LandMarkname>Chatta Chowk <Description> Chatta Chowk (Covered Bazaar) – True to the name, this is a covered bazaar between the gate and the fort itself, now filled with souvenir hawkers. </Description> </LandMarkname> </LandMarkType> </See> like i have to do this kind of structure i ,So can you help me to convert Regards Prashant --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Sep 3, 2009 at 4:54 AM, prashanth hiremath<prashanthhiremath2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> like i have to do this kind of structure i ,So can you help me to convertSo what have you tried so far, and how isn''t it giving you the result you''re looking for? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
Thank u for reply K i will send you the code ,and also the input and output i am getting .I will send how the output like INPUT is <see><span class="mw-headline">Red Fort</span> <li> <b>Chatta Chowk</b> (Covered Bazaar) – True to the name, this is a covered bazaar between the gate and the fort itself, now filled with souvenir hawkers. </li><li> <b>Diwan-i-Am</b> (Hall of Public Audience) – This building separates the outer court from the inner court, and has a marble platform for the emperor''s throne. </li> <span class="mw-headline">Agrsa</span> <li> <b>very Beautiful</b> A minor palace at the northmost end of the Fort, this was originally the residence of a prince, but it was converted into a tea house by the British, a function it continues today. Basic meals go for around 60 rupees, drinks 10-20 rupees, and it also has the cleanest toilets around. </li><li> <b>Diwan-i-Am</b> (Hall of Public Audience) – This building separates the outer court from the inner court, and has a marble platform for the emperor''s throne. </li> So s I able to pull the text from the html inform of array but i dont know how to put the text to currespoding elements <LandMarkType> Red Fort <LandMarkName>Chatta Chowk <Description>(Covered Bazaar) – True to the name, this is a covered bazaar between the gate and the fort itself, now filled with souvenir hawkers. </Description> </LandMarkname> </LandMarkType> i have to continue for all i mean for next text also So that I am not getting to do through loop so can u help me Regards Prashant On Thu, Sep 3, 2009 at 5:35 PM, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8@public.gmane.orgm> wrote:> > On Thu, Sep 3, 2009 at 4:54 AM, prashanth > hiremath<prashanthhiremath2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > like i have to do this kind of structure i ,So can you help me to convert > > So what have you tried so far, and how isn''t it giving you the result > you''re looking for? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Sep 3, 2009 at 5:26 AM, prashanth hiremath<prashanthhiremath2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: Personally, I''d probably do something like this with XSLT, but... Aside from that, this example looks very strange -- do you really intend that LandMarkName be a child of LandMarkType, and so on?> <LandMarkType> Red Fort > <LandMarkName>Chatta Chowk > <Description>(Covered Bazaar) – True to the name, this is a covered bazaar > between the gate and the fort itself, now filled with souvenir hawkers. > </Description> > </LandMarkname> > </LandMarkType>I would think you would want e.g. <LandMark> <LandMarkType>Red Fort</LandMarkType> <LandMarkName>Chatta Chowk</LandMarkName> ... </LandMark> Frankly, your example doesn''t make sense -- an xpath query on LandMarkName is going to return the Description tags and value as well, which seems an odd use case :-) FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
K i will try and if any problem i will ask u On Thu, Sep 3, 2009 at 6:14 PM, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8@public.gmane.orgm> wrote:> > On Thu, Sep 3, 2009 at 5:26 AM, prashanth > hiremath<prashanthhiremath2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Personally, I''d probably do something like this with XSLT, but... > > Aside from that, this example looks very strange -- do you really > intend that LandMarkName be a child of LandMarkType, and so > on? > > > <LandMarkType> Red Fort > > <LandMarkName>Chatta Chowk > > <Description>(Covered Bazaar) – True to the name, this is a covered > bazaar > > between the gate and the fort itself, now filled with souvenir hawkers. > > </Description> > > </LandMarkname> > > </LandMarkType> > > I would think you would want e.g. > <LandMark> > <LandMarkType>Red Fort</LandMarkType> > <LandMarkName>Chatta Chowk</LandMarkName> > ... > </LandMark> > > Frankly, your example doesn''t make sense -- an xpath query on > LandMarkName is going to return the Description tags and value > as well, which seems an odd use case :-) > > FWIW, > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---