[xsd-users] XML string over Google Protocol Buffers.

Boris Kolpackov boris at codesynthesis.com
Thu Sep 16 01:43:54 EDT 2021


Mark Mowers <mowers at brsc.com> writes:

> somname::v2::LOBType lobType (l_id);
> .... // lobType is populated with data types
>   XSDErrorHandler errHandler;   // My own generic error handler
>   ::xml_schema::flags flags = 0;
>   xml_schema::namespace_infomap map;
>   map["aa"].schema = xmlObjs_xsd;  // file schema name
>   map["aa"].name   = m_xml_xsd_schema;  // path to file schema
> 
>   std::ostringstream ostrm;
> 
>   // format the LOB xml
>   somname::v2::LOB (ostrm, lobType, errHandler, map, "UTF-8");
> 
>   std::string xmlString = std::move (ostrm.str());

Try to print xmlString at this point (or view it in the debugger).
Does it contain the expected XML? If yes, the problem is somewhere
downstream (your code, gRPC, etc). If it is empty, then the issues
is likely with the way you have setup the serialization. Try to
replace it with just the call to the generated serialization function
(without any custom error handlers, etc). If that makes a difference,
then the problem is likely with your serialization code. (Perhaps
there is an error but your error handler ignores it?)



More information about the xsd-users mailing list