@angelarg wrote:
Hi!
I’m currently trying to convert an XML to a JSON Object in my Ionic app. I’ve tried the x2js plugin and also jsonix (but this one won’t work). The thing is, with x2js I can convert the xml to a json with the same attribute names of each field, but what i want is to rename them in the object.
let’s say the XML has an attribute “n” and i want it to be mapped as “name” in the object.
(I know this can be done with JAXB in a java project, for example)I appreciate your support in advance.
cli packages:
@ionic/cli-utils : 1.19.1 ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
local packages:
@ionic/app-scripts : 3.1.11 Cordova Platforms : android 6.4.0 Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1 Node : v6.10.3 npm : 5.6.0 OS : Windows 10
Posts: 1
Participants: 1