senjuhashirama / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

Not detected use of load() instead of load_file() #211

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the fragment below I mistakenly wrote doc.load() instead of doc.load_file() 
but the library insists to answer: "XML parsed without errors".

To me "MappaPresentazione.xml" does not look like correct XML. Maybe a validity 
check is missing.

I'm on Win 7 using PugiXML 1.2
Thanks for looking!
mario

pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file("MappaPresentazione.xml");
if(result)
{
   std::cout << "XML parsed without errors" << std::endl;
}
else
{
   std::cout << "XML parsed with errors" << std::endl;
   std::cout << "Error description: " << result.description() << std::endl;
}

Original issue reported on code.google.com by siliconv...@gmail.com on 10 Aug 2013 at 5:56

GoogleCodeExporter commented 9 years ago
This is a known issue; I was reluctant to fail parsing for empty documents 
because there are some valid document fragments (i.e. <?xml?><!--test-->) that 
result in an empty document with default parsing flags, and parsing should not 
fail or pass depending on the flags.

However, there seems to be an easy way to do this validation without causing 
issues - I'll try to implement that.

Original comment by arseny.k...@gmail.com on 21 Aug 2013 at 6:40

GoogleCodeExporter commented 9 years ago
Issue 212 has been merged into this issue.

Original comment by arseny.k...@gmail.com on 5 Sep 2013 at 2:51

GoogleCodeExporter commented 9 years ago

Original comment by arseny.k...@gmail.com on 9 Feb 2014 at 12:48

GoogleCodeExporter commented 9 years ago

Original comment by arseny.k...@gmail.com on 9 Feb 2014 at 12:50

GoogleCodeExporter commented 9 years ago
Fixed in r980.

Original comment by arseny.k...@gmail.com on 11 Feb 2014 at 6:51