while
(KeyCount<TotalKeys){
if((!xmlStrcmp(cur->name,(const xmlChar *)Keys[KeyCount].Name))){
KeyCount++;
cur=cur->xmlChildrenNode;
}
if(cur->next==NULL){
cur=xmlNewTextChild(cur,NULL,(xmlChar *)Keys[KeyCount].Name,NULL);
int res;res=xmlSaveFile(CONFIG_FILE,doc);
KeyCount++;
}
else{
cur=cur->next;
}
}
Keys is an array of char[128].
xmlDocPtr doc;
and
xmlNodePtr cur;
Basically the file is written exactly as it was, and the xmlNewTextChild returns NULL.
What would the proper way to insert either of the following:
<NODE NAME>VALUE</NODE NAME>
or
<NODE NAME></NODE NAME>
Thanks!
Ron