我已经浏览了数十篇关于此的帖子,但没有一个能解决我的问题。我有这个 xml 文件。
<?xml version="1.0" encoding="UTF-8"?>
<scene>
<file>sphere.d3<file/>
</scene>
我有这个非常简单的功能,现在只需打开文件
string* loadXML(string file){
XMLDocument xml_doc;
xml_doc.LoadFile("/home/pedro/Documents/CG/TP/scene.xml");
if(xml_doc.ErrorID() != 0) {
cout << xml_doc.ErrorName();
return nullptr;
}
return nullptr;
}
然而,它吐出来
XML_ERROR_MISMATCHED_ELEMENT
不知道为什么,文件是如此简单。任何帮助表示赞赏,谢谢