Skip to main content
GameDev.net gamedev.net
🔒 Locked

Extracting text data from XML string using tinyxml

Started by medhassu May 22, 2006 at 5:50 AM 1 replies 950+ views
Original Post
medhassu
medhassu
Hai Associates, I have been working on how to retrieve the text data from XML form using tinyxml parser since 2 days.From the following XML string i have to retrieve the data. Mgmt 645268923afce PubSubComm-3 ok Hello 412 Welcome to India I should have to get the each field(i.e Mgmt,Hello,412 etc)in to seperate variables.So kidly give me some suggestions to write the APIs to extract thedata. I am using tinyxml_2_3_3. Some body has given the solution to print all contents of XML string. Thank you very much. But my reqquirement is i have to copy some selected values in to the buffer which should be retuned to the calling function. Please give some solution to it . [Edited by - medhassu on May 23, 2006 6:16:23 AM]
grelle
grelle
Something like this

void Load(){  TiXmlDocument Doc;  Doc.Parse(your_string);  RecurseTree(&Doc);}void RecurseTree(TiXmlNode *pNode){  printf("%s\n", pNode->Value());  TiXmlNode *Child = pNode->FirstChild();  for(; Child; Child = pNode->IterateChildren(Child))    RecurseTree(Child);}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.