On Jul 14, 2007, at 12:17 , Pawan Gupta wrote:
Hello Everybody,
I have pretty basic question abut REXML. I want to put the
String "John doe" in titles array, if attribute name is equal to
"93". Please see the code below. I could not find how to do it..
any help would be very appriciated.
Here is the XML i am trying to parse
<entrydata columnnumber="2" name="93">
<text>John doe</text>
</entrydata>
<entrydata columnnumber="1" name="86">
<numberlist>
<number>0</number>
<number>0</number>
</numberlist>
</entrydata>
Code in controll
doc.elements.each('viewentries/viewentry/entrydata') do |ele|
if ele.attributes["name"] = "93"
titles << // here I like to put <text> value in titles array.
end
end
Thanks,
Pawan Gupta
Pawan this mailing list is for items regarding Mongrel (http://
mongrel.rubyforge.org/).
Ask your question on the ruby mailing list (http://groups.google.com/
group/ruby-talk-google ).
--
Wayne E. Seguin
Sr. Systems Architect & Systems Admin
[EMAIL PROTECTED]
_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users