1

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.

Soumen
  • 1,006
  • 2
  • 12
  • 19
  • possible duplicate of [XML Schema to C++ Classes](http://stackoverflow.com/questions/445905/xml-schema-to-c-classes) – mkaes Jan 10 '12 at 11:04
  • @mkaes its a duplicate indeed, i wonder why it didn't come up while searching in SO. But even that thread didn't suggest any proper tool. – Soumen Jan 10 '12 at 12:38

2 Answers2

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).

Tom
  • 2,369
  • 13
  • 21
  • yes @Tom CodeSynthesis XSD is good in what it does. It generates clean classes (even though i would prefer pointers than references) but there's a catch, once classes are generated and you have your binary/library ready to executed ..it will need additional code systhensis runtime for execution. And unfortunately runtime code is not open. It kinda kills the whole spirit of class generation (i understand that they need to earn for writing awesome software). Also not all platform runtime are free (like AIX you need to buy) – Soumen Apr 15 '13 at 16:28
0

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.

Community
  • 1
  • 1
Nick Bastin
  • 30,415
  • 7
  • 59
  • 78