QString pds::getSingleValueFromXML(QString filepath,QString element) { // qDebug()<<XML file Path::::<open(QIODevice::ReadOnly QIODevice::Text)) { show_pop_message(Couldn`t open file,Information!!); return Couldn`t open file; } QXmlStreamReader xml(file); while(!xml.atEnd() && !xml.hasError()) { QXmlStreamReader::TokenType token = xml.readNext(); if(token == QXmlStreamReader::StartDocument) { continue; } if(token == QXmlStreamReader::StartElement) { if(xml.name() == element) { response=xml.readElementText(); return response; } } } if(xml.hasError()) { return XML Parsing Error; //show_pop_message(XML Parsing Error,Information!!); } xml.clear(); return response; } QList< QMap > pds::LoadXmlDataToMap(QString filepath,QString MainTag,QList elementList) { QList< QMap > root; QMap person; QFile* file = new QFile(filepath);//xml file path if (!file->open(QIODevice::ReadOnly QIODevice::Text)) { qDebug( Failed to open file for reading. ); person[ERROR]=Couldn`t open file; root.append(person); return root; } QDomDocument doc(mydocument); if (!doc.setContent(file)) { qDebug( Failed to parse the file into a DOM tree. ); person[ERROR]=Failed to Parse the XML Data; root.append(person); return root; } QDomElement docElem = doc.documentElement(); QDomNodeList nodeList=docElem.elementsByTagName(MainTag); if(nodeList.count()==0) { qDebug()<<Inside No Tag ; person[ERROR]=NO DATA FOUND; root.append(person); return root; } for(int ii = 0;ii
©