Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Friday, March 19, 2010

sudo gem install nokogiri-happymapper

This is it, you can install my fork of happymapper using the above command! It's now available on Rubygems.org.

It's a replacement to happymapper, so you want to use it using:
require 'happymapper'

Thank you to Matt/GoodGets for using the fork and pushing me to publish it as a gem! Enjoy! :)

Tuesday, December 1, 2009

Presentation of my Happy Mapper fork at the last RORO Sydney

Last November I did a presentation of the Happy Mapper fork I developed. The video is available on Vimeo. Unlike the description says, it is a fork using Nokogiri to replace XML Object, but watching it will clear everything out! It's a lightning talk, so I'm sure I won't waste too much of your time :)

You can also find all the videos from RORO on Vimeo. Enjoy!

Monday, October 12, 2009

Updated dam5s-happymapper to use Nokogiri

I've updated my version of Happymapper to use Nokogiri. It should be faster. The original Happymapper had already been forked to use Nokogiri by Roland Swingler.

Nokogiri is a ruby gem to parse XML and HTML using XPath or CSS selectors. It's written mostly in C, and is very fast. I intend to use this version of Happymapper in an upcoming project with intensive parsing!

Monday, September 21, 2009

XML Parsing in Ruby using Happy Mapper

Part of my job consists in getting a lot of data from different sources. Whether it's a SOAP or REST webservice, a TCP Socket, or simply files on a FTP, most of this data is in XML format.

There are different libraries to parse XML in Ruby. We used to do with XML Object, but the resulting code is really difficult to read and maintain. We prefer Happy Mapper.

It is an XML to object mapping library. You can find the source on Github. I also created a fork to add support for text node in mapping objects. It also includes the changes from David Bolton.

The resulting code is very readable and easy to maintain... and the library can be used in most cases. It's also quite fast since it uses XML Object for the actual parsing. Examples are in the source tree, and the source itself is quite short and easy to understand.

Enjoy easy and happy XML parsing! :)