From: Phlip Date: 2007-10-21T08:46:22+09:00 Subject: Re: Why's (Poignant) Guide to Ruby (is this guy ok?) > I don't know about all his work, but hpricot is fantastic and popular. The specific deal with Hpricot is nobody wants to parse and write HTML that could be ill-formed. XHTML is simple to parse, and browsers can't accept strict XHTML. So HTML lived in a dead-spot. If you had to edit it, you'd target specific strings with gsub. And if this lead to an encoding problem, you'd simply have garbage-in-garbage-out. With Hpricot, you can freely convert ill-formed HTML into an object model, and back into HTML We used Hpricot to launch a successful project at work, with its Lilu wrapper. This let our graphic artists upgrade our graphics, decoupled from our developer's source code. Lilu uses Hpricot to locate class tags and replace their contents with our data. This, in turn, decouples our graphics teams and development teams, leading to a very successful website. And Hpricot allows assertions in tests that read HTML, via assert_hpricot. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax