Please run the following code with your file:
#include <QtXml>
#include <QtCore>
int main(int argc, char **argv){
if(argc<2) return 1;
qDebug
() <<
"File path:" <<
QFileInfo(file).
absoluteFilePath();
qDebug() << "File exists:" << file.exists();
file.
open(QFile::ReadOnly|QFile
::Text);
qDebug() << "File open:" << file.isOpen();
int line, int column;
if(dom.setContent(&file, &error, &line, &column)){
qDebug() << dom.toString(4);
} else {
qDebug() << "Error:" << error << "in line " << line << "column" << column;
}
return 0;
}
#include <QtXml>
#include <QtCore>
int main(int argc, char **argv){
if(argc<2) return 1;
QFile file(argv[1]);
qDebug() << "File path:" << QFileInfo(file).absoluteFilePath();
qDebug() << "File exists:" << file.exists();
file.open(QFile::ReadOnly|QFile::Text);
qDebug() << "File open:" << file.isOpen();
QDomDocument dom;
QString error;
int line, int column;
if(dom.setContent(&file, &error, &line, &column)){
qDebug() << dom.toString(4);
} else {
qDebug() << "Error:" << error << "in line " << line << "column" << column;
}
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks