c++ - How to parse XML file in a generic way -
i'm using configuration file such when user needs change configurations, don't have recompile code. have specific configuration structure parse myself. suggested use xml.
i'm using libxml2 in c++ , i'm looking generic way parse xml configuration file, when change structure of xml tree in future don't have change parsing function much.
can please suggest standard way parse xml file generically not depending on structure or type?
some things note:
1. xml built such leafs hold values of configuration , tree xml structure readability purposes.
2. values of xml file can string or int or array etc , store xml value according type.
3. if you're suggesting library, please suggest libraries used commercially too.
4. parsing not long function of strcmp
i hope question clear enough, in advance!
i can suggest using boost property tree library supports xml 1 of several formats.
alternatively might take @ rapidxml library (afaik used internally boost). it's small, header-only library have copy project. no separate compilation or dependency needed in case.
Comments
Post a Comment