{ "id": "84227", "key": "TIMOB-6853", "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": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2012-02-14T23:43:40.000+0000", "created": "2011-12-22T15:02:05.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-02-14T23:43:40.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. PROBLEM DESCRIPTION\r\nCode that was working up to recent CI build is now failing when querying xml attributes from an xml node.\r\n\r\nh4. STEPS TO REPRODUCE\r\n1. Create new mobile project\r\n2. Paste below code into the app.js\r\n3. Run\r\n\r\nh4. ACTUAL RESULTS\r\n[INFO] Attributes: null\r\n\r\nh4. EXPECTED RESULTS\r\n [INFO] Attributes: [object TiDOMNamedNodeMap] [INFO] Value: appcelerator \r\n\r\nh4. CODE\r\n{code}\r\nvar str = \"\";\r\nvar xml = Ti.XML.parseString(str); \r\nTi.API.info(\"Attributes: \"+xml.attributes); \r\nif (xml.attributes && (xml.attributes.length > 0)) { \r\n Ti.API.info(\" Value: \"+xml.attributes.item(0).nodeValue); \r\n} \r\nwin = Ti.UI.createWindow();\r\nwin.open(); \r\n{code}\r\n\r\nh4. WORKAROUND\r\nA workaround was provided, and rejected from the customer. \r\n\r\n{code}\r\nvar str = \"\" \r\nvar xml = Ti.XML.parseString(str); \r\nvar node = xml.documentElement;\r\n//Ti.API.info(\"Attributes: \"+xml.attributes); \r\nif (node.attributes && (node.attributes.length > 0)) { \r\n Ti.API.info(\" Value: \"+node.attributes.item(0).nodeValue); \r\n};\r\n\r\nwin = Ti.UI.createWindow();\r\nwin.open(); \r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: xml attributes broken in 1.8.0.1", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": null, "comment": { "comments": [ { "id": "177657", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This change is to conform to the DOM LEVEL 2 spec. See the description of \"Attr\":\r\n\r\nhttp://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-637646024\r\n\r\nAnd the IDL definition for \"Document\":\r\n\r\nhttp://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document\r\n\r\nIn particular:\r\n\r\n* A Document is not an Element\r\n* Document provides the {{documentElement}} accessor for the element representing the root node of the document (the document object's first child)\r\n\r\nIn the event that it was expected that you could directly access Element information off of a Document, this would require that we implement all Element methods on a Document (to conform to expected behavior, being able to retrieve Attr nodes off an object implies it is an Element, and that it should be interacted with as one). This violates the IDL specification by re-typing Document as a subtype of Element.\r\n\r\nThe \"workaround\" is actually the correct way to interact with an XML tree.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-29T16:46:12.000+0000", "updated": "2011-12-29T16:48:53.000+0000" }, { "id": "177658", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Additionally, see the behavior definition for {{Node.attributes}} in this section of the spec:\r\n\r\nhttp://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247\r\n\r\nThe property is defined, but MUST (according to spec) return {{null}} for non-Element nodes.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-29T16:57:08.000+0000", "updated": "2011-12-29T16:57:31.000+0000" }, { "id": "180192", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing based on Stevens comments", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-23T11:12:51.000+0000", "updated": "2012-01-23T11:12:51.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }