XML SAX Machines

Description

Assorted XML SAX readers, filters and writers for nokogiri.

Dependencies

Ruby
  • nokogiri ~> 1.2.2

Install

  • Via git: git clone git://github.com/shanna/xml-sax-machines.git

  • Via gem: gem install shanna-xml-sax-machines -s gems.github.com

Flow

XML::SAX::Filter

Pass through filter. Base class for creating chainable SAX filters.

XML::SAX::Pipeline

A linear sequence of SAX filters.

Filters

XML::SAX::Handler

Base class for creating chainable SAX handlers.

XML::SAX::Debug

Debuging output for SAX events.

XML::SAX::Builder

Build in-memory document trees from SAX streams.

XML::SAX::FragmentBuilder

Process in-memory record based document fragments. Builds well balanced XML chunks matching an XPath into a partial in-memory document tree for processing by a callback block.

Recognition

This library is my interpretation of patterns introduced to me through Perl’s XML::SAX::Machines. All credit to Barrie Slaymaker and contributors.

TODO

  • Tee filter.

  • Json reader/writer?

  • Any other Ruby parsers that can generate a SAX stream?

  • Namespace handling in XML::SAX::Builder and XML::SAX::FragmentBuilder.

Copyright © 2009 “Shane Hanna”. See LICENSE for details.