I've got a XML File looking like:
<?xml version="1.0" encoding="UTF-16"?>
<Table>
<Dataset>
<Year>Year1</Year>
<Month>Month1</Month>
<Day>Day1</Day>
</Dataset>
<Dataset>
<Year>Year2</Year>
<Month>Month2</Month>
<Day>Day1</Day>
</Dataset>
</Table>
And I want to read this file with C++. My code looks like:
XMLElement* xeTable = xeExport->FirstChildElement("Table");
XMLElement* xeDataset = xeTable->FirstChildElement("Dataset");
XMLElement* xeYear = xeDataset->FirstChildElement("Year");
XMLElement* xeMonth = xeDataset->FirstChildElement("Month");
XMLElement* xeDay = xeDataset->FirstChildElement("Day");
XMLText* xnYear = xeYear->FirstChild()->ToText();
const char* cYear = xnYear->Value();
XMLText* xnMonth = xeMonth->FirstChild()->ToText();
const char* cMonth = xnMonth->Value();
XMLText* xnDay = xeDay->FirstChild()->ToText();
const char* cDay = xnDay->Value();
It reads year, month and date of first dataset. What to do know, for reading data of next dataset? I superiored to delete the first dataset after reading so I can read the second dataset again with FirstChildElement();. But I didn't get it.
Can anyone help?
to elaborate: