And on the second test case:

<collection>
  <list>
     <object id="123" />
     <object id="456" />
     <definition word="Evaporation" definition="Evaporation.."/>
     <definition word="Condensation" definition="Condensation.."/>
  </list>
</collection>

The error is here:

 def children_array_to_hash(hash={})
   hash[child.name] = map do |child|
     returning({}) { |sub_hash| child.children_to_hash(sub_hash) }
   end
   hash
 end

There is no check to see if the element name has changed from object to definition....

Charlie

--
Charlie Savage
http://cfis.savagexi.com

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to