Forum: Ruby Re: new to Ruby and XML

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
87e9a89c53ccf984db792113471c2171?d=identicon&s=25 Kroeger, Simon (ext) (Guest)
on 2006-05-08 11:35
(Received via mailing list)
Hi Hunter,

quick and dirty:

Hash[*xml.scan(%r{>([^>]*)</f>}).flatten]

returns

{"12"=>"AAF",
 "7"=>"AAE",
 "13"=>"AAG",
 "8"=>"AAA",
 "9"=>"ISA",
 "1"=>"AAA",
 "2"=>"AAB",
 "4"=>"AAC",
 "5"=>"AAD"}

cheers

Simon
This topic is locked and can not be replied to.