XML in Ruby (or C++?)

J

Joao Barros

Dear Ruby users,

I am (still) ignorant about Ruby, but, from the very few things I
read, it seems a very nice language. I would like to know some
opinions regarding Ruby's suitability to parse XML files into an
internal Ruby representation so that they can be manipulated by Ruby
code and then written down to a new XML file.
Is it a good idea to do it in Ruby? What about efficiency? Should I do
it with C++ (with lots of templates ;-|) ? I already know quite a bit
(?) of C++ and that is the reason why I am also considering it.

Thanks a lot in advance for any opinions. I need them!

Joao
 
B

Brian Candler

I am (still) ignorant about Ruby, but, from the very few things I
read, it seems a very nice language. I would like to know some
opinions regarding Ruby's suitability to parse XML files into an
internal Ruby representation so that they can be manipulated by Ruby
code and then written down to a new XML file.
Is it a good idea to do it in Ruby? What about efficiency? Should I do
it with C++ (with lots of templates ;-|) ? I already know quite a bit
(?) of C++ and that is the reason why I am also considering it.

Thanks a lot in advance for any opinions. I need them!

There are several XML parsing libraries for Ruby; the one which seems most
popular (and has been integrated into Ruby-1.8.0, which should be finally
released in the next day or so) is called REXML.

I think you should try it - it will be about 100 times easier than writing
the equivalent C++ code :)

Speed is something you'll have to try out for your application. If you are
parsing multi-megabyte XML files it might be an issue, but in the
applications I use it it's not a problem at all.

Regards,

Brian.
 

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

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,351
Latest member
RoxiePulli

Latest Threads

Top