Parsing XML with Hpricot, a Gem of a Ruby Gem

XML is often touted as being "human readable." In fact, the goal was to avoid having to spend too much time trying to parse the language at all. However, XML often falls short of that goal. Luckily for Ruby developers, a quick search for a parsing solution will turn up Hpricot. This Ruby gem can parse and manipulate XML with amazing flexibility and ease.

Installing the Hpricot Gem

Hpricot is packaged as a Ruby gem, meaning the easiest way to install it is to use the RubyGems package manager. Of course, this also means you'll need to install Ruby, so take care of that now if Ruby's not already installed on your system.

Next, install Hpricot by opening a terminal window and executing the following command: