[xsde-users] Insert Raw XML with XSD/e serialization

Boris Kolpackov boris at codesynthesis.com
Tue Nov 29 11:25:53 EST 2016


Hi Samuel,

Samuel Friedman <samuel.friedman at cammlab.org> writes:

> I'm more than willing to test that the string I want to insert is well
> formed XML and I would love to have some easy code to do so.

I think your best option is to setup an Expat parser (part of libxsde)
to parse your XML fragment as a memory buffer and then route all the
callbacks to the underlying serializer (Genx) to be serialized. You
will get both well-formedness validation from parsing and Genx will
"embed" your fragment seamlessly into the output (indentation, etc).

There is the evolution/passthrough example that shows how to do the
second part of this. Setting up Expat should be pretty straightforward.

Boris



More information about the xsde-users mailing list