# A working from\_xml including child relationships

**URL:** <https://www.ruby-forum.com/t/a-working-from-xml-including-child-relationships/159651>\
**Category:** Rails\
**Created:** [February 6, 2009, 6:29pm UTC](https://www.ruby-forum.com/t/a-working-from-xml-including-child-relationships/159651 "2009-02-06T18:29:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamfowleruk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@adamfowleruk](https://www.ruby-forum.com/u/adamfowleruk)\
**Post date:** [February 6, 2009, 6:29pm UTC](https://www.ruby-forum.com/t/a-working-from-xml-including-child-relationships/159651/1 "2009-02-06T18:29:36Z")

</div>

Hi all,

I’ve been looking at some options for getting a from\_xml  
implementation working with ActiveRecord based classes. I had a few  
issues and couldn’t resolve them, so I rolled my own. Seems to work  
well for simple parent \> child relationships, including collections.

I thought I’d post in case anyone else was similarly afflicted. Here’s  
the blog post to get the code. Please add comments to let me know what  
you think. (Or to tell me I’m an idiot and missed something!)

[http://web.me.com/adamfowleruk/adamsapple/Blog/Entries/2009/2/6\_Ruby\_incoming\_XML\_processing.html](http://web.me.com/adamfowleruk/adamsapple/Blog/Entries/2009/2/6_Ruby_incoming_XML_processing.html)

Regards,

Adam.

---

<div class="post-metadata">

**Author:** ![adamfowleruk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@adamfowleruk](https://www.ruby-forum.com/u/adamfowleruk)\
**Post date:** [February 6, 2009, 9:18pm UTC](https://www.ruby-forum.com/t/a-working-from-xml-including-child-relationships/159651/2 "2009-02-06T21:18:45Z")

</div>

Oh BTW just added recursive to\_xml too, which supports  
ActiveRecord::Base objects

[http://web.me.com/adamfowleruk/adamsapple/Blog/Entries/2009/2/6\_Ruby\_to\_xml\_implementation.html](http://web.me.com/adamfowleruk/adamsapple/Blog/Entries/2009/2/6_Ruby_to_xml_implementation.html)

Adam.
