[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

most simple xml library

rubyist101

10/7/2003 10:50:00 AM

I'm looking for a simple and easy to use xml creator/parser
library for Ruby.
My program doesn't need all bells&whistles offered by
complex libraries, rather a way to manage structured data
and transfer it in a portable fashion among different
hardware architectures.

Basically, I need these functions:

1. Create a xml structure.
2. Add/delete an item to/from the structure.
3. Assign a value to a given item.
4. Move an item/substructure from a structure to a
different one (or to a different level of the same structure)
5. Parse the structure (find an item by name or by value, etc).


Any suggestions greatly appreciated.
Thanks in advance.
3 Answers

Samuel Tesla

10/7/2003 8:48:00 PM

0

Have you looked at REXML? It comes standard with Ruby 1.8.0. You can
find more information about it here:

http://www.germane-software.com/softw...

--
Samuel

wcrowshaw

10/10/2003 1:33:00 AM

0

Samuel Tesla <samuel@alieniloquent.com> wrote in message news:<87vfr0dbi6.fsf@alieniloquent.com>...
> Have you looked at REXML? It comes standard with Ruby 1.8.0. You can
> find more information about it here:
>
> http://www.germane-software.com/softw...

Any java/ruby programmers out there know how this lib compares to the
fantastic java lib called "jdom" (http://www...)?

ser

10/10/2003 5:06:00 PM

0

wcrowshaw@yahoo.com (W. Crowshaw) wrote in message news:<5e26a92c.0310091733.58e87e14@posting.google.com>...
> Samuel Tesla <samuel@alieniloquent.com> wrote in message news:<87vfr0dbi6.fsf@alieniloquent.com>...
> > Have you looked at REXML? It comes standard with Ruby 1.8.0. You can
> > find more information about it here:
....
> Any java/ruby programmers out there know how this lib compares to the
> fantastic java lib called "jdom" (http://www...)?

It doesn't, except that the APIs both suck less than DOM. REXML
predates jdom, but jdom is very similar to ElectricXML (which was the
inspiration for REXML). REXML hasn't looked like ElectricXML for a
long time, by the way, so the "E" in REXML is the only connection it
has to ElectricXML.

A less catty answer would be: they're similar in that they both try to
stay out of the way of the programmer, and they have similar APIs.
They diverge in large parts because REXML leans heavily on certain
Rubisms (associative arrays, Procs) and uses Ruby naming conventions.

I'd guess that there are only so many ways you can minimize an XML
tree API while maintaining full functionality to all XML concepts.
Because of the naming conventions of the XML spec, methods in
simplified APIs tend to look similar, and toolkits tend to act the
same.