2014-05-04 01:38:20 +08:00
|
|
|
parser1 = require 'xml2json'
|
|
|
|
parser2 = require 'json2xml'
|
2014-05-01 23:30:09 +08:00
|
|
|
|
2014-05-04 01:38:20 +08:00
|
|
|
xml2json = (xmlStr) ->
|
|
|
|
parser1.toJson(xmlStr)
|
2014-05-01 23:30:09 +08:00
|
|
|
|
2014-05-04 01:38:20 +08:00
|
|
|
json2xml = (jsonObj) ->
|
|
|
|
#parser2(jsonObj)
|
|
|
|
parser1.toXml(jsonObj)
|
2014-05-01 23:30:09 +08:00
|
|
|
|
2014-05-04 01:38:20 +08:00
|
|
|
exports.xml2json = xml2json
|
|
|
|
exports.json2xml = json2xml
|