Re: [xml] search a node in a tree

On Wed, 2002-10-16 at 10:13, laurent nameshield net wrote:

A buffer contains thoses datas :
<message version="1" action="C" type="request">

// I build a tree.
    doc = xmlParseMemory(buffer, strlen(buffer)) ; printf("tester si erreur
arbre provoque une erreur\n") ;

// Theses lines are ok
    message = xmlDocGetRootElement(doc) ;
    pszAction=xmlGetProp(message, "action") ;
    pszType=xmlGetProp(message, "type") ;

// I  need to get the content of the node "zone". The content is ""
// To search the node , i try to use followings instructions :

    cur=xmlStringGetNodeList(doc, (const xmlChar *) "zone") ;
    printf("contenu de zone =%s\n", xmlNodeGetContent(cur)) ;

Have you looked at the tutorial example which shows you how to walk
through your tree?

John Fleck
jfleck inkstain net (h) jfleck abqjournal com (w)

"Sometimes, a diner is all about the mac and cheese." 
  - Zippy the Pinhead

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