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

B

Bill Walton

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
 
P

Piyush Ranjan

[Note: parts of this message were removed to make it a legal post.]

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.
 
B

Bill Walton

Hi Piyush,

Piyush said:
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
 
T

Trans

Background:

I'm working on a library to read XML files and convert their contents to =
a set of Ruby objects. =A0The XML files conform to an ASTM standard and the=
re's an XSD. =A0The Java guys are using JAXB to generate their classes from=
the XSD. =A0I'm not aware of an equivalent to JAXB for Ruby and so am goin=
g 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 Ru=
by 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top