Yukisama / x2js

Automatically exported from code.google.com/p/x2js
0 stars 0 forks source link

json2xml is not working when any of the elements has the value undefined. #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an object as following:
var ev = {
   allDay: true,
   editable: undefined,
   end: undefined,
   id: undefined,
   start: 1351551600,
   timeZoneOffset: 1,
   title: "eventSource2"
}

2. Call the function json2xml_str(ev)

What is the expected output? What do you see instead?
it would or create no xml for the undefined, or empty

What version of the product are you using? On what operating system?
1.0.8, on Chrome

Please provide any additional information below.
I adapted line 236
if(subObj!=null && subObj instanceof Object && subObj!=undefined) {

and line 247
else if ( subObj != undefined ) {

Original issue reported on code.google.com by andries....@gmail.com on 27 Nov 2012 at 11:04

GoogleCodeExporter commented 8 years ago
Thank you for this report. I've fixed this in v1.0.9 that available for 
download.

Original comment by abdulla....@gmail.com on 28 Nov 2012 at 6:28

GoogleCodeExporter commented 8 years ago

Original comment by abdulla....@gmail.com on 28 Nov 2012 at 6:28