{
"id": "112540",
"key": "TIMOB-13477",
"fields": {
"issuetype": {
"id": "1",
"description": "A problem which impairs or prevents the functions of the product.",
"name": "Bug",
"subtask": false
},
"project": {
"id": "10153",
"key": "TIMOB",
"name": "Titanium SDK/CLI",
"projectCategory": {
"id": "10100",
"description": "Titanium and related SDKs used in application development",
"name": "Client"
}
},
"fixVersions": [],
"resolution": null,
"resolutiondate": null,
"created": "2013-04-08T21:11:40.000+0000",
"priority": {
"name": "Low",
"id": "4"
},
"labels": [
"supportTeam"
],
"versions": [
{
"id": "14162",
"description": "Release 3.1.0",
"name": "Release 3.1.0",
"archived": true,
"released": true,
"releaseDate": "2013-04-16"
},
{
"id": "15856",
"description": "Release 3.2.1",
"name": "Release 3.2.1",
"archived": false,
"released": true,
"releaseDate": "2014-02-10"
}
],
"issuelinks": [],
"assignee": null,
"updated": "2018-02-28T20:03:25.000+0000",
"status": {
"description": "The issue is open and ready for the assignee to start work on it.",
"name": "Open",
"id": "1",
"statusCategory": {
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"components": [
{
"id": "10206",
"name": "iOS",
"description": "iOS Platform"
}
],
"description": "h6.Problem\r\nThere appears to be a difference in parsing XML between Android and iOS. \r\n\r\nIts required to check the nodeName of the first child found in a particular XML document, \"firstChild.nodeName\" should return 'LOGON_RESPONSE'. What we get from iOS is 'Text', because the DOM element thinks this is just a text node. \r\n\r\nAfter using a removeWhitespace custom function the discrepancy may be noticeable even easier.\r\n\r\nh6.Steps to reproduce\r\n1. Take the XML fragment below\r\n2. Monitor console output\r\n\r\nh6.Simple snippet code\r\n{code}\r\nvar xmlTest = '' +\r\n'' +\r\n' ACK' +\r\n' 2013-03-28T09:13:42.786125+00:00' +\r\n' ' +\r\n' ' +\r\n' ' +\r\n' TEST' +\r\n' TEST SITE 1' +\r\n' ' +\r\n' ' +\r\n' TEST2' +\r\n' TEST SITE 2' +\r\n' ' +\r\n' ' +\r\n' ' +\r\n' ' +\r\n' TEST' +\r\n' EXTER' +\r\n' NEW JOB GROUP' +\r\n' ' +\r\n' ' +\r\n' TEST2' +\r\n' EXTER' +\r\n' NEW JOB GROUP' +\r\n' ' +\r\n' ' +\r\n' ' +\r\n'';\r\n\r\nvar xml = Ti.XML.parseString(xmlTest);\r\nTi.API.info('Name of xml nodeName: '+xml.nodeName);\r\n\r\nvar nodes = xml.documentElement.childNodes;\r\nTi.API.info(\" nodes: \" + nodes);\r\n\r\nTi.API.info('Name of first node:'+xml.firstChild.nodeName);\r\n\r\nfunction removeWhitespace(str) {\r\n// Function removes all whitespace from an XML fragment, so it will parse correctly in iOS. \r\n return str.replace(/\\>[\\t ]+$/g, \">\").replace(/\\>[\\t ]+\\<\").replace(/[\\t ]+\\';\nvar xmlDoc = Ti.XML.parseString(xmlString);\n\nTi.API.info(xmlDoc.firstChild.nodeName);\n$.index.open();\n{code}\n\nThe bug has turned up in their actual app, but he was able to reduce it down and reproduce with the simple test case above. \n\nTested with Ti 3.1.3GA\n",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2013-12-04T00:27:02.000+0000",
"updated": "2013-12-04T00:27:02.000+0000"
}
],
"maxResults": 4,
"total": 4,
"startAt": 0
}
}
}