How to read xml data and insert to mysql schema by nodejs




var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
port : 3306,
user : 'root',
password : '',
database : 'test'
});
connection.connect(function(err){
if(err) throw err;
});

var xml = '<member>
<name>Harry Potter</name>
<age>18</age>
<gender>Male</gender>
<house>Gryffindor</house>
</member>';


And then what Should I have to do ? or How to map the xml tag with column table ?


No comments:

Post a Comment