1 Attachment(s)
DOM XML reader - Not getting any proper output
Hi,
Below is my code & xml file. I am trying to read a xml file and store the contents. But its not working. Please help
Code:
int ParseConfigFile::populateUserValues ( string &OS, string &dir, string &logPath )
{
QFile file("config_v1.xml");
if ( doc.setContent( file.readAll() ) == false )
return 1;
element = doc.documentElement();
QDomElement firstChild
= list.
at(0).
toElement();
// will return the first child
s1 = firstChild.text();
s2 = secondChild.text();
s3 = thirdChild.text();
OS = s1.toStdString();
dir = s2.toStdString();
logPath = s3.toStdString();
return 0;
}