[TIMOB-533] XML parsing not working (Kitchen Sink 0.9.3)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2011-04-19T11:14:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Backlog |
Components | iOS |
Labels | ios, node, nodevalue, spec, text, xml |
Reporter | Ryan G |
Assignee | Kevin Whinnery |
Created | 2011-04-15T02:31:15.000+0000 |
Updated | 2012-01-10T15:53:20.000+0000 |
Description
XML comes in fine but the individual fields cannot be extracted with the following code:
Ti.API.info("user node = "+this.responseXML.documentElement.getElementsByTagName("screen_name").item(0).nodeValue);
You can see in the output below (very last line) that user node = null
[INFO] twitter xml [object TiDOMDocument] text
Thu Mar 23 00:03:19 +0000 2006
123
finished analyzing smam/ac success rates
web
false
false
17
Tony Stubblebine
tonystubblebine
Mill Valley, CA
Founder of CrowdVine. Interested in events, smallbiz, social software.
http://a1.twimg.com/profile_images/609823904/tonystubblebine3_normal.png
http://www.stubbleblog.com
false
6555
0D7CDA
000000
0000ff
91FFE9
131411
218
Tue Mar 21 21:01:35 +0000 2006
24
~28800
Pacific Time (US & Canada)
http://a1.twimg.com/profile_background_images/32/OTHER-Lista_1280x1024.jpg
false
false
false
2072
en
false
[INFO] user node = null
Comments
- Tyloub 2011-04-15
Seems that in the new Kitchen Sink, you need to use : this.responseXML.documentElement.getElementsByTagName("screen_name").item(0).text >> .text and not .nodeValue
- Stephen Tramer 2011-04-15
Code seems to indicate that returning "null" for nodeValue on an element is correct, but in this case, we're always grabbing the text node. This is an actual bug!
- Michael Pettiford 2012-01-10 Closing issue Tested with Ti Studio 1.0.8.201201091758 Ti Mob SDK 1.8.0.1 1_8_X KS The fail case no longer occurs