I'm currently using XmlSimple in Ruby to convert XML to a hash using the xml_in method. Everything is really nice, except for the fact that the resulting hash keys are all lowercase, whereas the XML element names were mixed-case.
Here's an example:
hash = XmlSimple.xml_in( xml_string, { 'KeyAttr' => 'name',
'ForceArray' => false,
'NoAttr' => true,
'KeyToSymbol' => true,
'SuppressEmpty' => "" } )
So, for example, this xml:
<aclEntry>
<aclEntryId>Stuff here</aclEntryId>
<principalName>Stuff here</principalName>
</aclEntry>
results in this hash:
{ :aclentryid => "Stuff Here", :principalname => "Stuff here" }
I've looked over the documentation for XmlSimple, and didn't see any option that indicated it could maintain mixed-case in the document-to-hash conversion.
Is there any way to use XmlSimple to maintain case sensitivity in the resulting hash? If not, is there an alternative Ruby XML parser that can generate a hash that maintains case-sensitivity like this?