I was using Xerces for a while to parse XML config files that were part of a game I was making (and never really got off the ground, of course).
It was a hellllluva lot of boilerplate to tell it to throw me exceptions at any type of error (xml syntax validation, plus using my .xsd schema validation, etc.).... and at the end of the day I think it would still tell me that an empty document was "okay" lol. My gut feeling was that I really couldn't trust that getting the "ok" from my parser would guarantee me anything about the data; I would have to do my own validation anyway as I load each value from the file into its corresponding data structure. That is, using XML as a way of storing C++ objects isn't particularly useful.
But having the XML format specification (provided by DTD or other schema language, or just ad-hoc) is useful in general I guess, so other ppl can know if they're providing you with data that your code
should consider valid in some sense. But then you might still have mismatches with, say, what your schema's type validation considers a valid floating-point number vs. whatever library you're using to parse the string representation of the number from the XML file into whatever C++ type you're using to store the number, like maybe "double" on whatever platform you're compiling towards.
I guess I was hoping for something like C++ code generation directly from the schema; I give a schema, I get code that necessarily loads things correctly according to the schema, as well as code that validates incoming data according to the schema so I don't have to do any error-checking myself! Sadly, this doesn't make any practical sense since at the end of the day, the rest of my code presumably needs to do logic based on whatever type of data is being stored lol. So I think I'm just crazy
But don't give up, Xerces is a fine parser, like you can use it to get your data okay. It's just not very automatic, there's a ton of boilerplate and manual checking you'll need to do. But it might still be better than writing, say, a custom parser for a custom INI file format? I dunno.
geez that was a useless wall-of-text, srry ^_^