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.
Vodex N. (Guest)
on 2005-12-12 20: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!
Shawn M. (Guest)
on 2005-12-12 20: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 M.
Vodex N. (Guest)
on 2005-12-13 21:04
Shawn M. 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 M.

Yes, this seems to be what I'm looking for, Not sure if I should thread
reply in a mailing list, but thanks!
Joshua H. (Guest)
on 2005-12-13 23:34
I'm working on one of these, too:
http://shnoo.gr/articles/2005/12/11/xmlactiverecord

-- Josh

Vodex none wrote:
> Shawn M. 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 M.
>
> Yes, this seems to be what I'm looking for, Not sure if I should thread
> reply in a mailing list, but thanks!
subimage interactive (Guest)
on 2005-12-14 01: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...
Vodex N. (Guest)
on 2005-12-18 11: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 removed_email_address@domain.invalid,
thx muchly.
This topic is locked and can not be replied to.