title: Get all info from an xml doc
body: <p>I try to do something that appears to me as really simple :
  I have this line</p>
  
  <pre><code>&lt;example status="OK" value="200"/&gt;
  </code></pre>
  
  <p>and i want to parse it with libxml2 and get the value of "status" and "value", but all my try failed.</p>
  
  <p>Here my actual code :</p>
  
  <pre><code>#include &lt;libxml/tree.h&gt;
  #include &lt;libxml/parser.h&gt;
  
  void Display_Node(xmlDocPtr doc, xmlNodePtr node)
  {
      // printf("test :: %s\n", xmlNodeListGetString(doc, noeud, 1));
      // printf("test :: %s\n", xmlNodeListGetString(doc, noeud-&gt;children, 1));
  
      printf("%2d :: ", node-&gt;type);
      if (node-&gt;type == XML_ELEMENT_NODE) {
          xmlChar *chemin = xmlGetNodePath(node);
          if (node-&gt;children &amp;&amp; node-&gt;children-&gt;type == XML_TEXT_NODE) {
              xmlChar *contenu = xmlNodeGetContent(node);
              printf("%s -&gt; %s\n", chemin, contenu);
              xmlFree(contenu);
          } else {
              printf("%s\n", chemin);
          }
          xmlFree(chemin);
      } else {
          printf("NOTHING\n");
      }
      // printf("\n");
  }
  
  void MyXml_Dump(xmlDocPtr doc, xmlNodePtr node)
  {
      for (xmlNode *tmp = node; tmp; tmp = tmp-&gt;next) {
          Display_Node(doc, tmp);
          if (tmp-&gt;children) {
              MyXml_Dump(doc, tmp-&gt;children);
          }
      }
  }
  
  int main(void)
  {
      char *xml = "&lt;example status=\"OK\" value=\"200\"/&gt;";
  
      xmlDocPtr doc = xmlParseMemory(xml, strlen(xml));
  
      if (!doc) {
          printf("Error while parsing.\n");
          return (1);
      }
  
      xmlNodePtr racine = xmlDocGetRootElement(doc);
      if (!racine) {
          fprintf(stderr, "No xml content.\n");
          xmlFreeDoc(doc);
          return (1);
      }
  
  
      printf("Xml Dump :\n");
      MyXml_Dump(doc, racine);
      printf("\n");
  
  
      xmlFreeDoc(doc);
  }
  </code></pre>
  
  <p>My result is this :</p>
  
  <pre><code>Xml Dump :
   1 :: /example
  </code></pre>
  
  <p>I try to use xmlNodeListGetString or xmlNodeGetContent in order to dump the value I want, but that doesn't work (same result for both).</p>
  
  <p>It seems that the value simply aren't here (because I add a printf in every node and it appear there is only one node), so I begin to wonder if I use the correct parsing function (xmlParseMemory) or if this kind of value is ignored by libxml2.</p>
  
  <p>It's not a library that I use frequently, so i'm a little lost.
  Is there a way to perform what I want ?</p>