hind
3rd August 2014, 05:34
When there is a parenthesis contained in a node of xml file the QDomDocument::setContent gives error "error occurred while parsing element". The error column is right where the parenthesis is. Remove all parentheses and there is no error.
Codes:
QFile file(QApplication::applicationDirPath()+"/a.xml");
file.open(QIODevice::ReadOnly | QIODevice::Text);
QDomDocument doc;
doc.setContent(&file);
file.close();
xml file:
<root>
<node(>
</node(>
</root>
I have googled but found no restriction to parentheses usage in xml file. And I can save nodes with parentheses successfully, with QDomDocument::save. How can I retrieve it?
Codes:
QFile file(QApplication::applicationDirPath()+"/a.xml");
file.open(QIODevice::ReadOnly | QIODevice::Text);
QDomDocument doc;
doc.setContent(&file);
file.close();
xml file:
<root>
<node(>
</node(>
</root>
I have googled but found no restriction to parentheses usage in xml file. And I can save nodes with parentheses successfully, with QDomDocument::save. How can I retrieve it?