require ''rubygems''
require ''nokogiri''
require ''rexml/document''
include REXML
doc1=Nokogiri::HTML(open(''Delhi.txt''))
builder = Nokogiri::HTML::Builder.new do |doc|
doc.html {
doc.landmark {
doc1.search(''//span'').each do |x|
doc.text x.inner_text
end
doc1.search(''//b'').each do |y|
doc.landname y.inner_text
end
}
}
end
puts builder.to_html
<html>
<landmark>
<landmarkname>
<desc>
</desc>
</landmarkname>
<landmark>
</html
but i am getting like
<html>
<landmark>
<landmarkanme> </landmarkname>
<landmarkanme> </landmarkname>
<landmarkanme> </landmarkname>
<desc></desc>
<desc></desc>
</landmark>
</html>
CAN anybody help me to correct it
Regards
prashanth
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---