[xml] xmlParseMemory, xmlDocGetRootElement, ->xmlChildrenNode



"child" in the code below ends up being NULL. I'm having a hard time figuring out why. This is the XML it's parsing; if I dump gteldata, it get it back.

<?xml version="1.0"?>
<cid id="modem:/dev/ttyS2:[1415528707]">
  <NAME>TESTNAME</NAME>
  <NMBR>TESTNMBR</NMBR>
</cid>


gteldata=xmlParseMemory(rbuf, l);
printf("gteldata:%p\n",gteldata);
if (!gteldata) return TRUE;

root = xmlDocGetRootElement(gteldata);
printf("root:%p\n",root);
if (!root)
{
        xmlFreeDoc(gteldata);
        gteldata = NULL;
        return TRUE;
};
        
child = root->xmlChildrenNode;
printf("child:%p\n",child);

... should I not be using xmlChildrenNode or xmlDocGetRootElement?

--
Michael Rothwell
e: rothwell at holly-springs.nc.us
k: http://www.rothwells.info/rothwell-public-key.txt





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]