Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2094] [android - XML] Bug on Parse XML and non existing Node

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionInvalid
Resolution Date2012-08-22T12:14:57.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, parse, reported-1.4.0, xml
Reporterviviboss
AssigneeNeeraj Gupta
Created2011-04-15T03:10:19.000+0000
Updated2017-03-09T23:37:25.000+0000

Description

Hi,

I tried to parse a XML, and made a control on Node Value :

if(objItems.list.item(c).getElementsByTagName("description")){

           desc = objItems.list.item(c).getElementsByTagName("description").item(0).text;
            Ti.API.info('DESCRIPTION :' +desc);

}

This Node don't exist in my XML document, but with this test i can passthru normaly, on Iphone it's true, the test return "NULL"

But On Android, the test return with Ti.API.Info("DESCRIPTION :"+objItems.list.item(c).getElementsByTagName("description"))

[INFO] [15,22418] DESCRIPTION :ti.modules.titanium.xml.NodeListProxy@44046fb8

I work on Android 2.2, and this code works on Iphone

Comments

  1. Stephen Tramer 2011-04-15

    Assigning to Don for triage.

  2. Junaid Younus 2012-08-22

    No runnable test case provided, unable to reproduce, ticket marked as invalid.
  3. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source