Nokogiri is an open source software library to parse HTML and XML in Ruby. It depends on libxml2 and libxslt to provide its functionality.

Overview

Developers of library state that it "makes it easy and painless to work with XML and HTML from Ruby". It markets itself as providing a "sensible, easy-to-understand API for reading, writing, modifying, and querying documents." The library provides functionality by relying on native parsers like libxml2 (CRuby), libgumbo (C99) and xerces (JRuby).

It is one of the most downloaded Ruby gems, having been downloaded over 700 million times from the rubygems.org repository.

Features

  • DOM Parser for XML, HTML4, and HTML5
  • SAX Parser for XML and HTML4
  • Push Parser for XML and HTML4
  • Document search via XPath 1.0
  • Document search via CSS3 selectors
  • XSD Schema validation
  • XSLT transformation
  • XML and HTML Builder

Enterprise support is available through tidelift, a paid subscription model, offering commercial support for open source applications.

External links