How to extract information from xml using node.js
There are plenty of methods available to extract information from an XML file and I have used the XPath select method to fetch the tag values. The following modules have to install using the NPM install Method. var fs = require ( 'fs' ), xml2js = require ( 'xml2js' ); const parser = new xml2js . Parser (); const xpath = require ( 'xpath' ), dom = require ( 'xmldom' ). DOMParser ; sample XML file name as test.xml. < groceryShop > < ownerName > xxxx </ ownerName > < name > DepartmentalStore </> < address > bangalore </ address > < pincode > 562320 </ pincode > </ groceryShop > The above modules will drive the process to fetch the information. //To read the file by using the readFile method which may be sync or async function fs . readFile ( 'test.xml' , function ( err , data ){ if ( err ){ //display error } else { // d...