[xml] newbie question.

Hi all:
  I am new to libxml2 (well, I should say new to entire XML stuff).  I have
a XML document looks like this:

                <FL> </FL>
                <BG> </BG>
                <SH> </SH>
                <INS> </INS>
                <DV> </DV>
                <INF> </INF>
        <MSG> </MSG>

I need to parse it and fill out the nodes content in FL,BG, SH. 
The code looks like this.

doc = xmlParseFile("./xml/wrapper.xml");
cur = xmlDocGetRootElement(wrapper_d); 

printf("root=%s\n", cur->name);
printf("child=%s\n", cur->name);

The result is:
root=TOP_MSG     (good , as I thougt)
child=text                (ooops, I thought it should be TOP!!)

How could I access those elements (FL, BG, SH,etc)? I thought those elements
should be the children nodes of the TOP elements, aren't they?

thank you

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