jnunemaker / crack

Really simple JSON and XML parsing, ripped from Merb and Rails.
MIT License
540 stars 93 forks source link

Exception from the special treatment of XML tags with type == file #40

Closed admgre closed 11 years ago

admgre commented 11 years ago

I was parsing an XML document (in this case, the XML configuration of a kvm domain) with Crack::XML.parse and it was throwing an exception.

After digging around this was because in the case where the tag has a type attribute set to file the children nodes are assumed to be strings. In this case the children are another XML tag and not a string causing an exception.

I also added a test as requested covering this bug.