Hello. There is a file with xml-markup.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <connectionStrings /> .... </configuration>
Using this function, we determine the success of the functions. And for some reason it is impossible to read the file. The correctness of the file path is verified. The file with the xml-extension gave - the result is the same.
bool Test() { tinyxml2::XMLDocument xml_doc; tinyxml2::XMLError eResult = xml_doc.LoadFile("Web.config"); std::cout << 1 << endl; if (eResult != tinyxml2::XML_SUCCESS) return false; // Здесь возникает ошибка чтения std::cout << 2 << endl; tinyxml2::XMLNode* root = xml_doc.FirstChild(); if (root == nullptr) return false; std::cout << 3 << endl; tinyxml2::XMLElement* element = root->FirstChildElement("configuration"); if (element == nullptr) return false; return true; }
The question is what am I doing wrong and how can I fix this?