0

I want to load an xml file and convert it into JSON in angularjs on the client side.

2
  • Try stackoverflow.com/questions/1773550/… Commented Oct 3, 2015 at 5:22
  • I think better option is to first grab xml on your server than convert it to json than response it to angularjs. Commented Oct 3, 2015 at 6:59

1 Answer 1

0

You have two options.

  1. Return the data from the API in format you require to prevent conversions (recommended).
  2. Convert the XML to JSON using javascript.

For approach #2 I'll recommend you this solution http://goessner.net/download/prj/jsonxml/

And please be sure to read the article 'Converting Between XML and JSON' (by Stefan Goessner) to overview details of the problems with conversions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.