nori
nori copied to clipboard
strip_namespaces doesn't work for attributes
XML:
<wd:Position_Data wd:Effective_Date="2022-02-01">
<wd:Position_ID>12345</wd:Position_ID>
</wd:Position_Data>
Ruby:
content = File.read('response.xml')
nori = Nori.new(strip_namespaces: true)
hash = nori.parse(content)
puts hash.inspect
Expected:
{"Position_Data"=>{"Position_ID"=>"12345", "@Effective_Date"=>"2022-02-01"}}
Actual:
{"Position_Data"=>{"Position_ID"=>"12345", "@wd:Effective_Date"=>"2022-02-01"}}
For the interested contributor, here's where a test case can be formulated.
https://github.com/savonrb/nori/blob/master/spec/nori/api_spec.rb#L33