[xml] how to read the second node?



Hello again ,thank you very much ,I solved last problem but the new question is coming out :(
the format of xml is like this :
<timetable>
        <direct_train>
                <train number = "suX1">
                        .........
                </train>
                <train number = "suX2">
                        .........
                </train>
        </direct_train>
        <passing1_train>
                <train1 number = "subX1">
                        .........
                </train1>
        </passing1_train>
</timetable>
I can use followed code: doc = xmlParseFile(docname);
                  cur = xmlDocGetRootElement(doc);
                          cur = cur->xmlChildrenNode;
                 cur = cur->next;//this point to <direct_train>;
to read the <timetable> as root node ;<direct_train> as its childrennode,but when I finish read the data in <direct_train>,I want to read data in <passing1_train>, do I need go back to the root node"<timetable>", and choose second
childrennode"<passing1_train>"? how can I do ?

thank you in advance
shen.peng

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus




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