0

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

IKavanagh
  • 5,799
  • 11
  • 40
  • 45
SURAJ
  • 41
  • 1
  • 5

1 Answers1

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.

Yuriy A.
  • 744
  • 3
  • 19