Forum: Ruby Any way to convert from hash to XML using builder?

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.
Ehud R. (Guest)
on 2008-10-16 18:52
Hi all,
Am I missing an obvious way to transform a hash into an XML builder
object?
I would like the key to be the tag, and value be the content. attributes
on a tag are something I don't really know how to represent - but
perhaps someone has already thought of that?

Thanks!
Mark T. (Guest)
on 2008-10-16 19:20
(Received via mailing list)
On Oct 16, 10:52 am, Ehud R. <removed_email_address@domain.invalid> wrote:
> Hi all,
> Am I missing an obvious way to transform a hash into an XML builder
> object?
> I would like the key to be the tag, and value be the content. attributes
> on a tag are something I don't really know how to represent - but
> perhaps someone has already thought of that?

Yep. http://xml-simple.rubyforge.org/

-- Mark.
Ehud R. (Guest)
on 2008-10-16 19:23
Mark T. wrote:
> On Oct 16, 10:52�am, Ehud R. <removed_email_address@domain.invalid> wrote:
>> Hi all,
>> Am I missing an obvious way to transform a hash into an XML builder
>> object?
>> I would like the key to be the tag, and value be the content. attributes
>> on a tag are something I don't really know how to represent - but
>> perhaps someone has already thought of that?
>
> Yep. http://xml-simple.rubyforge.org/
>
> -- Mark.

Thanks, I'll check it out.
This topic is locked and can not be replied to.