0

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

IKavanagh
  • 6,089
  • 11
  • 42
  • 47
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.
  • 750
  • 3
  • 19