My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

KindDom is an XML DOM XPath finder developed at Scout Labs within Ruby on Rails.

This small behavioral wrapper around libxml-ruby provides graceful transformation of the content inside XML responses.

Three Methods to Access XML Content

#content_for

An XPath-based content selector, returning the content of the first selected node. When content is found, the closure (block) is called with the content, enabling usage similar to a visitor pattern. This pattern allows your XML consumer to gracefully skip code for missing content.

#first_of, #collection_of

XPath-based node selection, returning "kind" nodes, with the same closure & default behaviors as #content_for.

News

Oct-10-2008 — After months of development, testing & usage within our Rails app, and now compatibility with the newest version of the underlying libxml-ruby gem, KindDom is stable & ready for production. Version 1.0.0 of the gem is available!

Docs

See the source code or rdoc for more help.

The tests are good examples too.

Installation

Install the gem to get the kindness:

  sudo gem install kind_dom

Gem Dependencies

Enhancement Ideas

  • return value type-casting from ActiveResource-style type & nil attributes
  • read/write DOM test cases

©2008 Scout Labs Inc. http://scoutlabs.com

Powered by Google Project Hosting