title: Uncaught TypeError: Cannot read property 'rows' of null
body: <p>I am trying to do an xml data parsing to html dynamic table.
  I have written the following code,ı am new in javascript.
  but when ı am debugging it says that error in debug:
  Uncaught TypeError: Cannot read property 'rows' of null.
  can you help me ? 
  code is here:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  var req = new XMLHttpRequest();
  
  req.open("GET", "today.xml", false); 
  req.send(null);
  
  var xmlDoc = req.responseXML;       
  
  var nsResolver = xmlDoc.createNSResolver( xmlDoc.ownerDocument == null ? xmlDoc.documentElement : xmlDoc.ownerDocument.documentElement);
  
  var iterator = xmlDoc.evaluate('/Tarih_Date/Currency', xmlDoc, nsResolver, XPathResult.ANY_TYPE, null );
  var result = iterator.iterateNext();
  var x = result.textContent;
  var table = document.getElementById("xmlTable")
  while (null != result.textContent)
  {
  
      var row = table.insertRow(0);
  
      var cell1 = row.insertCell(0);
      var cell2 = row.insertCell(1);
      var cell3 = row.insertCell(2);
      var cell4 = row.insertCell(3);
  
      cell1.innerHTML = result.childNodes[3].textContent;
      cell2.innerHTML = result.childNodes[5].textContent;
      cell3.innerHTML = result.childNodes[7].textContent;
      cell4.innerHTML = result.childNodes[9].textContent;
  
      result=iterator.iterateNext();
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;table id="xmlTable"&gt;
  
  &lt;/table&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>okey all the code is that.</p>