Dan Diebolt
7/13/2008 4:44:00 AM
[Note: parts of this message were removed to make it a legal post.]
>What I need, however is a method that tells me the first HTML tag of a fragment, whatever it is
Try this:
a_fragment = '<div id="my_first_div">first div<p>a paragraph</p><span>a span</span></div>'
doc=Hpricot(a_fragment)
tag=doc.search("[1]").first.name
=> "div"