Closed FilBot3 closed 8 years ago
The option you're missing is KeepRoot as described in the documentation (http://xml-simple.rubyforge.org). So, you could use
hash = XmlSimple.xml_in(File.open("search_by_change_id.xml"), :KeepRoot => true)
Keep in mind, though, that XmlSimple does not work well with XML namespaces that is the result will be
{"SearchByChangeRequestID"=>[{"xmlns:inv"=>"http://Remedy_Change_Request_LIB/Invoke", "xmlns:wser"=>"http://Remedy_Change_Request_LIB", "request"=>[{"ChangeRequestID"=>["CRQ000000905650"]}]}]}
When I use XmlSimple v1.1.5, I import an XML file like the one below, and it seems to drop the first element of the XML tag as seen in the Hash output towards the bottom. Is there some option I'm missing?