SimpleXML for you

Here's my first version to bring PHP SimpleXML functionality into Ruby.

Few people claimed REXML isn't simple enough for them if they compare that to PHP simple way. If you don't know what's the PHP way, here's an introduction:

     http://php.net/simplexml

Let me know what do you think about it.

This code is by no means feature complete or even usable. If this matures and people feel the need for it, I'll package it properly. If there's votes for it, maybe working version could be put on top of REXML, maybe even included on it.

If I've understand correctly REXML is now bundled as a standard library. If not, maybe SimpleXML should have multiple backends for most popular libraries out there (NQXML, some of these C-based perhaps).

Here's the short documentation

   http://www.cs.helsinki.fi/u/kaniemel/SimpleXML/doc/

for your perusal, and of course the few hundred lines of dispatching code:

   http://www.cs.helsinki.fi/u/kaniemel/SimpleXML/

Thanks,

     - Aleksi

Aleksi wrote:

Here's my first version to bring PHP SimpleXML functionality into Ruby.

Let me say that I was just pointed there's already a lib with (almost) same name:

   http://raa.ruby-lang.org/project/ruby-xml-simple/

I'm not robbing name. I just picked it up from the PHP world. And this lib name (if there's ever going to be one) will of course change. The functionality of that lib is almost the same as mine. Syntax is not completely same but close, and that version is written in C so it's faster in magnitudes, I'd guess.

I see point of having pure-ruby simple API over other XML libs fading away. Not completely of course, but at least there's something quite dumb ass easy to use already out there.

     - Aleksi

Aleksi wrote:

Here's my first version to bring PHP SimpleXML functionality into Ruby.

Few people claimed REXML isn't simple enough for them if they compare that to PHP simple way. If you don't know what's the PHP way, here's an introduction:

    http://php.net/simplexml

Let me know what do you think about it.

Have you looked at XmlSimple?

http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/68267
http://www.maik-schmidt.de/xml-simple.html

It appears to be based on Perl's XML::Simple.

It lets you access XML content as a series of hashes:

  puts config['server']['kalahari']['address'][1]

James

···

--

http://catapult.rubyforge.com
http://orbjson.rubyforge.com
http://ooo4r.rubyforge.com
http://www.jamesbritt.com