[Mongrel] Very basic question about REXML

Wayne E. Seguin wayneeseguin at gmail.com
Sat Jul 14 21:27:13 EDT 2007


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
wayneseguin at gmail.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070714/419a904c/attachment.html 


More information about the Mongrel-users mailing list