Home > Ruby, Technology > A five pointer on Hpricot Vs REXML

A five pointer on Hpricot Vs REXML

I’ve been learning to parse XML in Ruby for a while now using Hpricot and REXML. And here’s essentially what you should know if you are going through the same path

  1. Hpricot(as of this writing) is still *very* incomplete! It’s doesn’t support everything that you would want to do in Xpath. I had to jumps through hoops to get a few things done. REXML on the other hand works like a charm. Hpricot also behaves weirdly(and unpredictably) at places.
  2. Hpricot has parts of its implementation in C and way faster than REXML.
  3. I like the Hpricot syntax, which seemed more natural than what REXML uses
  4. REXML is very adament about content errors and would refuse to parse a document having a single misplaced ‘&’. Hpricot never complained.
  5. REXML is in the standard library
Categories: Ruby, Technology
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: