[xsd-users] Saving Partial XSD trees

Boris Kolpackov boris at codesynthesis.com
Sun Sep 11 07:39:00 EDT 2022


Paul McGrath <paul.s.mcgrath at gmail.com> writes:

> I'm looking to save sequences without requiring having to save the whole
> tree. The rationale behind this is to create a library of elements that can
> be then cloned into a tree.

Each XML Schema type is mapped to a C++ class that comes with a
parsing constructor (from DOMElement) and a serialization operator<<
(to DOMElement). So with some effort (i.e., create suitable DOMElement,
etc) you should be able to serialize a sequence of instances of such
classes.

The closest example to what you are trying to achieve is probably
cxx/tree/messaging/ (it also comes with DOM parsing/serialization
helpers which you will most likely find useful). There is also
cxx/tree/streaming/ that you may find relevant.



More information about the xsd-users mailing list