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! -- Posted via http://www.ruby-forum.com/.
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 On 12/12/05, Vodex none <vodex-YCpy1HD0M2cAvxtiuMwx3w@public.gmane.org> wrote:> 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 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 MathewsYes, this seems to be what I''m looking for, Not sure if I should thread reply in a mailing list, but thanks! -- Posted via http://www.ruby-forum.com/.
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!-- Posted via http://www.ruby-forum.com/.
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... -- seth at subimage interactive http://www.subimage.com/sublog/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
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-hRtevi7K+EU+Va1GwOuvDg@public.gmane.org, thx muchly. -- Posted via http://www.ruby-forum.com/.