How to store XML content into C/C++ structure
-
Hello everyone, I have this XML document and I need to store the content in a C/C++ structure. So far I can use MSXML to load the document and display it but how can I get it into C/C++ struct. I'm completely new to C/C++, can anyone help me to create a C/C++ struct to hold these data and also how to get the XML into the structure created. Many thanks! John Moss 28 8 Polygon Road London UK Karate Second degree black belt 1992 1994 1995 1996 :confused:
-
Hello everyone, I have this XML document and I need to store the content in a C/C++ structure. So far I can use MSXML to load the document and display it but how can I get it into C/C++ struct. I'm completely new to C/C++, can anyone help me to create a C/C++ struct to hold these data and also how to get the XML into the structure created. Many thanks! John Moss 28 8 Polygon Road London UK Karate Second degree black belt 1992 1994 1995 1996 :confused:
struct PERSONAL
{
CString szName;
int age;
int house_number;
CString szStreet;
CString szTown;
CString szCountry;
};struct SPORT
{
CString szStyle;
CString szBelt;
CString szChampion;
};struct CONTACT
{
PERSONAL personal;
SPORT sport;
};void foo()
{
std::vector<CONTACT*> vpContacts;for(int i=0; i<nContacts; i++)
{
vpContacts.push_back(new CONTACT);
vpContacts[i]->personal.szName = "Sam";
...
}do_something(...);
vpContacts.clear();
}- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
-
Hello everyone, I have this XML document and I need to store the content in a C/C++ structure. So far I can use MSXML to load the document and display it but how can I get it into C/C++ struct. I'm completely new to C/C++, can anyone help me to create a C/C++ struct to hold these data and also how to get the XML into the structure created. Many thanks! John Moss 28 8 Polygon Road London UK Karate Second degree black belt 1992 1994 1995 1996 :confused:
>> I can use MSXML to load the document and display >> it but how can I get it into C/C++ struct. well once u have read the file into the MSXML document it is in a C/C++ structure. why would u want to copy the data into another one?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
-
>> I can use MSXML to load the document and display >> it but how can I get it into C/C++ struct. well once u have read the file into the MSXML document it is in a C/C++ structure. why would u want to copy the data into another one?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete