Hpricot inner_html

Have the below xml

test test1 testdata 21546

i need to get data in MetaString tag to be displayed

doc2 = Hpricot(xml2)
doc2.search("/metas").each do |meta|
meta.search(’/Meta’).each do |metastring|
print("\n"+(metastring.at("/MetaString").inner_html))
end
end

i get the below error nessage

NoMethodError (undefined method `inner_html’ for nil:NilClass

Kindly help

if I give (doc2/‘metas’).inner_html

testtest1testdata21546

I am not able to understand why the tag gets closed before
enclosing as in the xml

i expeced the result as test

Kindly help

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs