I am working with a library that uses XSD for creating objects from their XML-based format in C++.
Basically, the inheritance diagram looks something like this:
class BaseClass: public xsd::cxx::tree::type;
class MainXmlObject: public BaseClass;
I think I need to convert my MainXmlObject
to a xerces::DOMDocument
and then use DOMWriter
to write the actual XML file, but I couldn't find the right routines so far.
What is the best way to do this?
It seems like adding the
--add-serialization
flag to the xsd code generation and then using something like:works. References: Adding serialization and details from the XSD guide.