From: Smp Mp on
Have the below xml

<metas>
<Meta name="date">
<MetaString name="value">test</MetaString>
</Meta>
<Meta name="url">
<MetaString name="value">test1</MetaString>
</Meta>
<Meta name="job">
<MetaString name="value">testdata</MetaString>
</Meta>
<Meta name="url">
<MetaString name="value">21546</MetaString>
</Meta>
</metas>

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
--
Posted via http://www.ruby-forum.com/.

From: Smp Mp on
if I give (doc2/'metas').inner_html

<meta name="date" /><metastring name="value">test</metastring><meta
name="url" /><metastring name="value">test1</metastring><meta name="job"
/><metastring name="value">testdata</metastring><meta name="url"
/><metastring name="value">21546</metastring>

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

i expeced the result as <meta name="date"><metastring
name="value">test</metastring><meta>

Kindly help
--
Posted via http://www.ruby-forum.com/.