[xsde-users] Enhancement request: support default property
Boris Kolpackov
boris at codesynthesis.com
Mon Dec 8 06:53:46 EST 2014
Hi David,
Reynolds, David <dpreynolds at srcinc.com> writes:
> Right now, the default property is ignored when the code is generated.
> It would be convenient to have the variable initialized with the default
> value (if supplied) at construction time. For example:
>
> <xsd:complexType name="LinkSettings">
> <xsd:sequence>
> <xsd:element name="Mode" type="xsd:unsignedShort" default="3"/>
> </xsd:sequence>
> </xsd:complexType>
I've added this to the TODO list, thanks for the suggestion. Note,
however, that XSD/e won't be able to do this always. For example, if
the element type is std::string and you have exceptions disables, then
there is no way to initialize the default value in the constructor (no
way to report the allocation error).
Boris
More information about the xsde-users
mailing list