Closed GoogleCodeExporter closed 9 years ago
Working on it
Thank you for submit issue!
Original comment by abdulla....@gmail.com
on 18 Oct 2012 at 5:49
Fixed in 1.0.8.
Thank you!
Original comment by abdulla....@gmail.com
on 18 Oct 2012 at 8:59
[deleted comment]
[deleted comment]
[deleted comment]
Hi Paul,
How did you loaded x2js file in to nodejs? I am getting final output as [object
Object]
here is my service code:
function x2js(req, res) {
var window={};
var DOMParser = require('xmldom').DOMParser;
var XMLSerializer = require('xmldom').XMLSerializer;
window.DOMParser=DOMParser;
var x2jsModule = require("./x2js.js");
var x2jsObject = new x2jsModule.X2JS()
// JSON to XML string
var xmlDocStr = x2jsObject.json2xml_str(
{
MyRoot : {
MyChild : 'my_child_value',
MyAnotherChild : 10,
MyArray : [ 'test', 'test2' ],
MyArrayRecords : [
{
ttt : 'vvvv'
},
{
ttt : 'vvvv2'
}
]
}
}
);
var xmlText = new XMLSerializer().serializeToString(xmlDocStr);
console.log(xmlText);its returning [object Object]
console.log(xmlText);its returning ??
res.send(xmlText);
};
and the way converted X2JS() to nodejs module is
exports.X2JS = function(config) {
Thanks
Peter
Original comment by peterkr2...@gmail.com
on 9 Dec 2014 at 4:23
Original issue reported on code.google.com by
pauled...@gmail.com
on 18 Oct 2012 at 1:54