Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip_namespaces doesn't work for attributes #95

Open
KieranP opened this issue Jul 25, 2022 · 1 comment
Open

strip_namespaces doesn't work for attributes #95

KieranP opened this issue Jul 25, 2022 · 1 comment
Labels
Help wanted If you want to assist development of Nori, this is a task which could be for you.

Comments

@KieranP
Copy link

KieranP commented Jul 25, 2022

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"}}
@olleolleolle
Copy link
Contributor

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

@olleolleolle olleolleolle added the Help wanted If you want to assist development of Nori, this is a task which could be for you. label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted If you want to assist development of Nori, this is a task which could be for you.
Development

No branches or pull requests

2 participants