ruby

Getting Started with Nokogiri and XML in Ruby

Here's a short post on getting started with Nokogiri - a Ruby gem that wraps libxml. I'm writing this because well, the docs at http://nokogiri.org/ kind of suck. I wanted to read a simple XML document. My XPath fu was a little rusty, although all I wanted to do was read some attributes from a root element, some element values off of the root, and then a short collection of items (very similar to an Atom document). My main bone of contention with the docs was their use of the `@doc.xpath("//character")` search operator at the very beginning of their parsing tutorial. How about we start from the beginning:

Category
Tags

Comments

Subscribe to ruby