xml to json conversion
Use case To convert the XML file to JSON file using node.js Consider sample XML file name as test.xml which contains the following information < groceryShop > < ownerName > xxxx </ ownerName > < name > DepartmentalStore </> < address > bangalore </ address > < pincode > 562320 </ pincode > </ groceryShop > There are different methods to convert XML to JSON .but here we will see customized JSON format where will see only required information details. we will create a JSON structure. output: var groceryitems = { ownerName : xxxx , name : DepartmentalStore , address : bangalore , pincode : 562301 }; // required modules: const fs = require ( 'fs' ), xml2js = require ( 'xml2js' ); //Step 1: To read file using fs.readfile syntax in node.js.it will fetch all the information and store it into one variable var data...
Wrapper Class
Apex Controller
Visualforce Page