[xsde-users] XSDE: Is more error information from generated code possible?

Boris Kolpackov boris at codesynthesis.com
Thu Nov 29 07:43:42 EST 2018


Boogaard, Joost <joost.boogaard at philips.com> writes:

> When serializing a class named ComputationResults we sometimes
> encounter the following error:
> 
> N4sgse17xsdegeneratedcode3xml18ComputationResultsE: schema error:
> expected element not encountered
> 
> Is there a way to get more detailed error information from generated
> code by XSDE?

Unfortunately not. In this particular case, the content model can
be complex with multiple possible elements (think of a required
xs:choice). Providing this information would be expensive both in
terms of implementation complexity as well as code bloat.

One (admittedly somewhat roundabout) way to help with this would
be to disable schema validation in the generated code, serialize
the (invalid) XML, and then re-parse it with a general-purpose
validating XML parser (e.g., Xerces-C++).



More information about the xsde-users mailing list