the below sites should help you.
http://www.germane-software.com/software/rexml/
http://www.germane-software.com/software/rexml/docs/tutorial.html
http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/index.html
On 8/30/06, jon
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Hi
>
> I have the following xml string that I have loaded into an REXML object
> as shown below.
>
> #xml stuff for saveRoute
> require ''rexml/document''
> include REXML
>
> Xml = "<test>
> <name>sam</name>
> <description>this is a test</description>
> <description>this is a test2</description>
> </test>"
>
> XmlObject = Document.new(Xml)
>
>
>
> 1. How can I get the value of name into a string?
> 2. Also how can I loop over to get all values of <description> into
an
> array?
>
> Thanks
> jon
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---