[xsd-users] "must-be-one-of' choices in xsd

Rob Ursem Rob.Ursem at cmgl.ca
Tue Apr 29 11:08:52 EDT 2014


Boris,

Thanks for the quick answer. I dismissed XSD/e before but now it seems I should check it out. What is the main difference between the two? 

Also there was an earlier message about an upcoming XSD 4 release. When is that due and is XSD/e trailing on that release schedule?

Regards,
Rob

________________________________________
From: Boris Kolpackov [boris at codesynthesis.com]
Sent: Tuesday, April 29, 2014 7:59 AM
To: Rob Ursem
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] "must-be-one-of' choices in xsd

Hi Rob,

Rob Ursem <Rob.Ursem at cmgl.ca> writes:

> Both sides of the choice are optional and the show that either is
> required. In fact, if you don't sp elements, the object writes
> without any notification, resultin invalid XML being generated.

The C++/Tree mapping flattens the compositor structure. There is
also no enforcement of schema constraints in the interface or at
runtime (for many cases such an enforcement will quickly make the
object model very hard to use).


> I could derive a subclass for every class [...]

Yes, type customization can be used to add custom validation checks.

Alternatively, you may want to check C++/Hybrid in XSD/e. This mapping
recreates the compositor structure so, for example, you would not be
able to specify both elements. The missing element would be detected
during serialization, if validation is enabled.

[1] http://www.codesynthesis.com/products/xsde/

Boris



More information about the xsd-users mailing list