title: Why does my XML code fail at getAttribute?
body: <p>Anyone shed any light onto why this doesn't work?!</p>
  
  <p>I've been at it for days now, I admit to being a bit of a newbie.</p>
  
  <p>I tried this as javascript in a browser with a captured set of the data and it was fine.</p>
  
  <p>Converted it to work in Appcelerator Titanium and it just craps out when it gets to the getAttribute, no matter how I try and format it.</p>
  
  <p>Someone said it was the data coming in but that seems to be ok, has to be me, its working for thousands of other people.</p>
  
  <p>Anyone help get me out of this rut and tell me what I am doing wrong?</p>
  
  <pre><code>var xhr = Titanium.Network.createHTTPClient();
  
  xhr.onload = function()
  {
  var xmlDoc = this.responseXML.documentElement;
  var xlinestatus=xmlDoc.getElementsByTagName('LineStatus');
  var xline=xmlDoc.getElementsByTagName('Line');
  var xstatus=xmlDoc.getElementsByTagName('Status');
  var newname = '';
  
  for (i=0;i&lt;xlinestatus.length;i++)
  {
  Ti.API.info(i);
  newname = xlinestatus.getElementsByTagName("Line ID")[0].getAttribute("Name");
  // newname = xlinestatus[i].getAttribute('Name');
  Ti.API.info(newname);
  // Ti.API.info(': ' + '&lt;/b&gt;');
  // Ti.API.info(xstatus[i].getAttribute("Description"));
  // Ti.API.info("&lt;br /&gt;");
  // Ti.API.info(xlinestatus[i].getAttribute("StatusDetails"));
  // Ti.API.info("&lt;br /&gt;");
  // Ti.API.info("&lt;br /&gt;");
  }
  
  };
  
  // open the client
  
  xhr.open('GET','http://cloud.tfl.gov.uk/TrackerNet/LineStatus');
  // xhr.open('GET','demodata.xml');
  
  
  // send the data
  xhr.send();
  </code></pre>