user3102241
user3102241

Reputation: 497

Pugixml: No document element found

I'm having some trouble loading the document (see link http://pastebin.com/FE3nDX9h) in pugixml.
I'm getting an error code of 16: No document element found which indicates that the XML file is invalid or empty which I think is neither.
I am using the default parsing method. Is there something I am missing?

edit: as requested heres some source code http://pastebin.com/USUjLC4q you will need to edit the paths.

Upvotes: 2

Views: 2196

Answers (1)

Evgeny Timoshenko
Evgeny Timoshenko

Reputation: 3259

You need xml_document::load_file but xml_document::load.

From pugi documentation:

There is also a simple helper function, xml_document::load, for cases when you want to load the XML document from null-terminated character string.

So, load's argument has to be xml by itself, not file name.

Upvotes: 7

Related Questions