A five pointer on Hpricot Vs REXML
September 11, 2007
Leave a comment
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
- 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.
- Hpricot has parts of its implementation in C and way faster than REXML.
- I like the Hpricot syntax, which seemed more natural than what REXML uses
- REXML is very adament about content errors and would refuse to parse a document having a single misplaced ‘&’. Hpricot never complained.
- REXML is in the standard library
Categories: Ruby, Technology