XML -> Ruby mapping: is there a 'standard' approach?

Background:

I’m working on a library to read XML files and convert their contents to
a set of Ruby objects. The XML files conform to an ASTM standard and
there’s an XSD. The Java guys are using JAXB to generate their classes
from the XSD. I’m not aware of an equivalent to JAXB for Ruby and so am
going at the task manually.

Question:

Is there a standard / recommended approach, documented somewhere, that I
could use to guide my decisions re: translating the XML structure into a
Ruby class hierarchy?

TIA,
Bill

I don’t know much about standard approach but there are a few libraries
out
there which you may use like http://roxml.rubyforge.org/

Regards
Piyush

p.s. If you get answer for this question do put it here.

Hi Piyush,

Piyush R. wrote:

I don’t know much about standard approach but there
are a few libraries out there which you may use like
http://roxml.rubyforge.org/

ROXML looks promising. Don’t know why Google didn’t find it for me.
I’ll
have to try some different queries. If you know of any more libraries
like
this I’d be very glad to get links.

Thanks!
Bill

On Aug 9, 10:19 am, “Bill W.” [email protected] wrote:

Background:

I’m working on a library to read XML files and convert their contents to a set of Ruby objects. The XML files conform to an ASTM standard and there’s an XSD. The Java guys are using JAXB to generate their classes from the XSD. I’m not aware of an equivalent to JAXB for Ruby and so am going at the task manually.

Question:

Is there a standard / recommended approach, documented somewhere, that I could use to guide my decisions re: translating the XML structure into a Ruby class hierarchy?

I worked on something like this for awhile (Blow/XDK), but it felt so
heavy and un-ruby that I let it go. Using more flexible tools like
XML::Simple, Hpricot, Builder, and Cherry/rQuery are so much nicer.

T.