[xml] Newbie question: Coverting XMLDocPtr to char xmlbuff[256]



Title: Newbie question: Coverting XMLDocPtr to char xmlbuff[256]

Hi,
     Iam new to C.
     I have contructed a XML Document as follows.

        xmlDocPtr doc = NULL; /* document pointer */
        xmlNodePtr root_node = NULL, node = NULL, node1 = NULL;/* node pointers */
        xmlDtdPtr dtd = NULL; /* DTD pointer */
        char buff[256];
        int i, j;
        LIBXML_TEST_VERSION;
        doc = xmlNewDoc(BAD_CAST "1.0");
        root_node = xmlNewNode(NULL, BAD_CAST "root");
        xmlDocSetRootElement(doc, root_node);
        xmlNewChild(root_node, NULL, BAD_CAST "node1",
        BAD_CAST "content of node 1");
        xmlNewChild(root_node, NULL, BAD_CAST "node2", NULL);

        /* This is the detination buffer*/
        char xmlbuffer[256];
       
        How do I convert this "doc" to xmlbuffer ?
        Iam struck at this place !
        You help would be appreciated !
               
Thanks
Vignesh



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