Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xsd-based code generator to build xml?

Tags:

c++

xml

xsd

I have a schema (xsd), and I want to create xml files that conform to it.

I've found code generators that generate classes which can be loaded from an xml file (CodeSynthesis). But I'm looking to go the other direction.

I want to generate code that will let me build an object which can easily be written out as an xml file. In C++. I might be able to use Java for this, but C++ would be preferable. I'm on solaris, so a VisualStudio plugin won't help me (such as xsd2code).

Is there a code generator that lets me do this?

like image 205
Tim Avatar asked Feb 26 '26 20:02

Tim


1 Answers

To close this out: I did wind up using CodeSynthesis. It worked very well, as long as I used a single xsd as its source. Since I actually had two xsds (one imported the other), I had to manually merge them (they did some weird inheritance that needed manual massaging).

But yes, Code Synthesis was the way to go.

like image 52
Tim Avatar answered Mar 01 '26 08:03

Tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!