title: Runtime error with tinyXML element access
body: <p>yester day was my first attempt. I am trying to catch the variable "time" in the following "new.xml" file</p>
  
  <pre><code>&lt;?xml version="1.0" standalone=no&gt;
  &lt;main&gt;
   &lt;ToDo time="1"&gt;
    &lt;Item priority="1"&gt; Go to the &lt;bold&gt;Toy store!&lt;/bold&gt;&lt;/Item&gt;
    &lt;Item priority="2"&gt; Do bills&lt;/Item&gt;
   &lt;/ToDo&gt;
   &lt;ToDo time="2"&gt;
    &lt;Item priority="1"&gt; Go to the Second&lt;bold&gt;Toy store!&lt;/bold&gt;&lt;/Item&gt;
   &lt;/ToDo&gt;
  &lt;/main&gt;
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>TiXmlDocument doc("new.xml");
  TiXmlNode * element=doc.FirstChild("main");
  element=element-&gt;FirstChild("ToDo");
  string temp=static_cast&lt;TiXmlElement *&gt;(element)-&gt;Attribute("time");
  </code></pre>
  
  <p>But I am getting run time errors from the third and fourth lines. Can anybody shed a light on this isssue?</p>