c++ - Error while parsing xml file in cpp using Rapidxml -


i trying read , xml file , parsing using below code can suggest mistake making.

it shows error

error: (e549) uncaught exception: configexception: expected <

void parsercnffile::read(void) {     ifstream file(m_file.m_name.c_str(), ios::in | ios::binary | ios::ate);     if (file.is_open()) {         file.seekg(0, ios::end);         int size = file.tellg();         m_file.m_contents = new char[size];         file.seekg(0, ios::beg);         file.read(m_file.m_contents, size);         file.close();     } else {         throw configexception("configexpection: not open \"" +                               m_file.m_name + "\"");     } }  void parsercnffile::parse(void) {     xml_document<> doc; // character type defaults char     try {         doc.parse<0>(m_file.m_contents);         flags     } catch (rapidxml::parse_error& e) {         cout << m_file.m_contents << endl;         throw configexception(string() + "configexpection: " + e.what());     }      xml_node<>* rootnode = doc.first_node();     xml_node<>* node = rootnode->first_node(); } 

this xml file.

<?xml version="1.0"?>     <globalsettings>         <simulation>             <timeresolution unit="ns"> 100 </timeresolution>             <duration unit="s"> 600 </duration>         </simulation>     </globalsettings> 


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -