0

i'm not looking for a function to parse xml to json, i already found one, which seems like its working just fine.

my problem is the xml file is an RSS feed, which most of the times has something like "media:content" or "media:creator" etc.. so when its parsed to JSON, i can't really access whats inside of it cause i can't just go "article.media:content", so i'm looking for a way to go around that and actually access what's inside "media:content" or whatever so i can display it in my react app (react native to be precise).

Ayoub Sen
  • 11
  • 1
  • 1
    You can access it with bracket notation. `article["media:content"]` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors – Ugur Eren Jul 13 '22 at 15:03
  • Does this answer your question? [JavaScript property access: dot notation vs. brackets?](https://stackoverflow.com/questions/4968406/javascript-property-access-dot-notation-vs-brackets) – Ugur Eren Jul 13 '22 at 15:05
  • If bracket notation does not work, then check if your parser can be configured to remove or transform namespaces (many can). – Yogi Jul 13 '22 at 15:14

0 Answers0