Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2873] When Parsing large amounts of XML and referencing nodes, randomly a node will either be nulled, or change type!!

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2012-01-04T14:35:34.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsxml,, xmlparsing
ReporterMatt Bryson
AssigneeMauro Parra-Miranda
Created2012-01-04T11:22:46.000+0000
Updated2016-03-08T07:47:49.000+0000

Description

We load a XML feed that has 400+ elements. Each has about 5 child nodes with numbers or a title, not much data. Looping over this XML, and converting it to JS randomly causes strange issues. First we get the element list using xmlDom.documentElement.getElementsByTagName('nodeName'), which works every time. Then we loop over those nodes, and for each child, we get the various sub node values we want and convert them to a JS object. During this loop, the current node value will randomly change from a TiDOMElement to either null, Object or TiDOMNodeList. Non of these are valid nodes, and thus subsequent node operations fail. The next iteration of the XML list will work fine. the function parseXML in the example file is passed the XHR responseXML object. In the retrieveNodeValue( nodeName, xmlNode) method, suddenly one of the calls the xmlNode passed in is null, Object or TiDOMNodeList - Not a NODE. All calls after this in the current loop will be the same,and then the next loop iteration it works fine.

Attachments

FileDateSize
example.js2012-01-04T11:24:36.000+00001165

Comments

  1. Paul Dowsett 2012-01-04

    Alan Leard has raised this in TIMOB-6985. Watch that ticket, if this issue is important to you.
  2. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source