title: Parsing XML Elements using TinyXML
body: <p><strong>UPDATE: Still not working :( I have updated the code portion to reflect what I currently have.</strong></p>
  
  <p>This should be a pretty easy question for people who have used TinyXML. I'm attempting to use TinyXML to parse through an XML document and pull out some values. I figured out how to add in the library yesterday, and I have successfully loaded the document (hey, it's a start).</p>
  
  <p>I've been reading through the manual and I can't quite figure out how to pull out individual attributes. After Googling around, I haven't found an example of my specific example, so perhaps someone here who has used TinyXML can help out. Below is a slice of the XML, and where I have started to parse it.</p>
  
  <p><strong>XML:</strong></p>
  
  <pre><code>&lt;EGCs xmlns="http://tempuri.org/XMLSchema.xsd"&gt;
    &lt;card type="EGC1"&gt;
      &lt;offsets&gt;
        [ ... ]
      &lt;/offsets&gt;
    &lt;/card&gt;
  
     &lt;card type="EGC2"&gt;
      &lt;offsets&gt;
        [ ... ]
      &lt;/offsets&gt;
    &lt;/card&gt;
  &lt;/EGCs&gt;
  </code></pre>
  
  <p><strong>Loading/parsing code:</strong></p>
  
  <pre><code>TiXmlDocument doc("EGC_Cards.xml");
  if(doc.LoadFile())
  {
      TiXmlHandle hDoc(&amp;doc);
      TiXmlElement* pElem;
      TiXmlHandle hRoot(0);
      pElem = hDoc.FirstChildElement().Element();
      if (!pElem) return false;
      hRoot = TiXmlHandle(pElem);
  
      //const char *attribval = hRoot.FirstChild("card").ToElement()-&gt;Attribute("card");
      pElem = hDoc.FirstChild("EGCs").Child("card", 1).ToElement();
      if(pElem)
      {
          const char* tmp = pElem-&gt;GetText();
          CComboBox *combo = (CComboBox*)GetDlgItem(IDC_EGC_CARD_TYPE);
          combo-&gt;AddString(tmp);
      }
  }
  </code></pre>
  
  <p><em><strong>I want to pull out each card "type" and save it to a string to put into a combobox. How do I access this attribute member?</em></strong></p>