问题
JAXB provides a very OOP way for handling xml data, is there any such alternative or script avaiable for c++. Looking for some tool which is OS independent ie: should work in linux, windows, etc.
Tool should be generating c++ classes like the way JAXB generated from XSD Schema.
We used have a perl script performing the same job in my previous organization but that was quite primitive (didn't handle inheritance etc). perl or python scripts will be super.
回答1:
I've been pretty impressed with CodeSynthesis XSD, although I only tinkered with it. One of the downsides (for our project, anyway) was that they provide custom classes to handle XML Schema items, but I don't believe you can change the mapping to provide your own (at least when I looked at it).
回答2:
Check out XML data binding for C++ like JAXB for java. This is a hard problem that even JAXB doesn't completely solve, but there are incomplete solutions that you might find useful.
来源:https://stackoverflow.com/questions/8802208/jaxb-equivalent-for-generating-c-classes-from-xsd