Forum: Ruby on Rails XML to Database via ActiveRecord

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.
10630868cfdcd768be7d5732b545cf3b?d=identicon&s=25 Vodex None (vodex)
on 2005-12-12 19:48
Hi all, First Post. I'm thinking of doing a Rails app where some source
data comes in from a XML file. I'd like to think there's some lovely
abstract helper for turning an XML doc into a bunch of ActiveRecord
objects  complete with one-to-manies for child nodes (object definition
assumed), although from my research REXML looks like it could do it with
some custom logic.

Is there something for this already or am I going to be the first to
produce it? :) Thanks!
595e04980a79a9e0d7f58efd73868e4c?d=identicon&s=25 Shawn Mathews (Guest)
on 2005-12-12 19:58
(Received via mailing list)
The Package you want is XML::Mapping, it converts XML documents into
ruby objects, I think you just have to do a gem install xml-mapping
and follow the doc's.

Shawn Mathews
10630868cfdcd768be7d5732b545cf3b?d=identicon&s=25 Vodex None (vodex)
on 2005-12-13 20:04
Shawn Mathews wrote:
> The Package you want is XML::Mapping, it converts XML documents into
> ruby objects, I think you just have to do a gem install xml-mapping
> and follow the doc's.
>
> Shawn Mathews

Yes, this seems to be what I'm looking for, Not sure if I should thread
reply in a mailing list, but thanks!
D444791fa932ffdb231ff35458e1d1fa?d=identicon&s=25 Joshua Harvey (joshmh)
on 2005-12-13 22:34
I'm working on one of these, too:
http://shnoo.gr/articles/2005/12/11/xmlactiverecord

-- Josh

Vodex none wrote:
> Shawn Mathews wrote:
>> The Package you want is XML::Mapping, it converts XML documents into
>> ruby objects, I think you just have to do a gem install xml-mapping
>> and follow the doc's.
>>
>> Shawn Mathews
>
> Yes, this seems to be what I'm looking for, Not sure if I should thread
> reply in a mailing list, but thanks!
Efe398b3b5436b0a8d4430090e8f86ea?d=identicon&s=25 subimage interactive (Guest)
on 2005-12-14 00:04
(Received via mailing list)
REXML is good. I do a weekly bulk import from XML using a ruby cron job.
It
gets the job done, but it definitely isn't as generic as you'd probably
want.

If you want to see the code email me...
10630868cfdcd768be7d5732b545cf3b?d=identicon&s=25 Vodex None (vodex)
on 2005-12-18 10:48
subimage interactive wrote:
> REXML is good. I do a weekly bulk import from XML using a ruby cron job.
> It
> gets the job done, but it definitely isn't as generic as you'd probably
> want.
>
> If you want to see the code email me...

Sorry for cluttering up the list, don't have your email address (I used
the forums).

Getting XML:Mapping to play with ActiveRecord is beyond my level at this
stage, and I suspect a bulk import'd be more effecive in any case.
Please email the code (or whatever) to tetmkuonrpxbrz@mailinator.com,
thx muchly.
This topic is locked and can not be replied to.