Hpricot and XML

Hi all,

I've got a little XML parsing problem, and I'd like to use hpricot to use it. The following script:

require 'rubygems'
require 'hpricot'

xml = <<-XML
     <gnc:account version="2.0.0">
       <act:name>Child Account</act:name>
       <act:id type="guid">4ba14634e8e52775af401ff8ae797316</act:id>
       <act:type>BANK</act:type>
       <act:commodity>
         <cmdty:space>ISO4217</cmdty:space>
         <cmdty:id>GBP</cmdty:id>
       </act:commodity>
       <act:commodity-scu>100</act:commodity-scu>
       <act:parent type="guid">e83af2b8702f9bfbde73bd723216fe4f</act:parent>
     </gnc:account>
XML

doc = Hpricot.XML(xml)
puts doc.at("act:id").inner_html
puts doc.at("act:name").inner_html
puts doc.at("act:type").inner_html
puts doc.at("act:parent").inner_html

produces the following output:

$ ruby test_hpricot.rb
4ba14634e8e52775af401ff8ae797316
Child Account
BANK
test_hpricot.rb:22: undefined method `inner_html' for nil:NilClass (NoMethodError)

I *think* the exception is being caused by hpricot parsing the :parent as a pseudoclass. Any ideas as to how I could make that not happen, or otherwise make the last line of the script correctly display the guid in question?

···

--
Alex