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

Namespaced XML not handled #103

Open
apsoto opened this issue Apr 6, 2011 · 5 comments
Open

Namespaced XML not handled #103

apsoto opened this issue Apr 6, 2011 · 5 comments

Comments

@apsoto
Copy link

apsoto commented Apr 6, 2011

For example, an xml file like this (sample rss)

<item>
  <title>Cool Video</title>
  <media:title>Cool Video</media:title>
</item>

node["title"]
#> ["Cool Video", "Cool Video"]

And there is no "media:title" key in the hash.

@apsoto
Copy link
Author

apsoto commented Apr 6, 2011

didn't realize it was not just a plain text field, I'll re add with clearer description:

For example, an xml file like this (sample rss):
<item>
<title>Cool Video</title>
<media:title>Cool Video</media:title>
</item>

  node["title"]
  #> ["Cool Video", "Cool Video"]

And there is no "media:title" key in the hash.

@kaiwren
Copy link
Contributor

kaiwren commented Apr 6, 2011

@achamian Could you take a look at this please?

@apsoto
Copy link
Author

apsoto commented Apr 19, 2011

any new info on this?

@achamian
Copy link
Contributor

I was going through the code and realised that the problem is with the Hash#from_xml which ignores the Namespaces all together. I was talking to @kaiwren to figure out if we can provide a wrapper which bypasses Hash#from_xml and provide some other deserialiser.

Have you come across any library which wraps Nokogiri, libxml-ruby, REXML etc. and doesn't have this problem or want to collaborate on writing one?

@apsoto
Copy link
Author

apsoto commented Apr 19, 2011

Yea, I traced it as well hoping it was a fix in wrest I could patch, but it was deep down in active support so I punted since I didn't have time to make changes to such a core lib at this time. From my little time spent diagnosing I think the correct fix is fixing it in active support instead of wrapping it. Unfortunately, this 'bug' hasn't been a blocker for me so I've moved on for the time being. I'll report back if I have time to work on fixing it, but not at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants