I'm using a configuration file such that when the user needs to change the configurations, I don't have to recompile the code. Currently I have a specific configuration structure that I parse myself. I was recently suggested to use XML.
I'm using libxml2 in c++ and I'm looking for a generic way to parse the XML configuration file, so that when I change the structure of the xml tree in the future I don't have to change the parsing function so much.
Can you please suggest a standard way to parse the XML file generically not depending on the structure or the type?
Some things to note:
1. The XML is built such that only the leafs hold the values of the configuration and the tree XML structure is just for readability purposes.
2. The values of the XML file can be string or int or array etc and I would like to store that XML value according to the type.
3. If you're suggesting some library, please suggest libraries that could be used commercially too.
4. I would like the parsing not to be a long function of strcmp
I hope the question is clear enough, Thanks in advance!