[xsd-users] Re: Access Violation when deleting objects

Boris Kolpackov boris at codesynthesis.com
Fri Nov 16 09:59:30 EST 2007


Hi Bruno,

bruno.marotta at fortis.com <bruno.marotta at fortis.com> writes:

> I think that the idea of having another contructor will be great. But
> it will be better to have an option for not creating empty classes
> like this one. For instance, my schema is something like this:
>
> ...
>	<xs:element name="ObligorID">
>		<xs:simpleType>
>			<xs:restriction base="xs:string">
>				<xs:minLength value="1"/>
>				<xs:whiteSpace value="collapse"/>
>			</xs:restriction>
>		</xs:simpleType>
>	</xs:element>

This type is not really empty: it includes a number of restrictions
which makes it not the same as xs:string. You are correct, right now
XSD generates an empty class for this. However, we are planning to add
support for restrictions as above so that they are enforced by the
generated types. Once we implement this, it won't make any sense
to have an option to treat it as an xs:string. So I think a c-tor
that allows you to initialize from a string literal has an advantage
of being a long-term solution.

Boris




More information about the xsd-users mailing list