I have strange behavior with an XSD generator that I cannot explain. I got the XSD as follows:
<xs:complexType name="StageSequenceElement" mixed="false"> <xs:complexContent> <xs:extension base="CoreObject"> <xs:sequence> <xs:element name="Description" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>Some Doc</xs:documentation> </xs:annotation> </xs:element> <xs:element name="StageRef" type="ObjectReference"> <xs:annotation> <xs:documentation>...</xs:documentation> </xs:annotation> </xs:element> <xs:element name="MinDuration_100ms" type="xs:int" nillable="true" minOccurs="0"> <xs:annotation> <xs:documentation>...</xs:documentation> </xs:annotation> </xs:element> <xs:element name="MaxDuration_100ms" type="xs:int" nillable="true"> <xs:annotation> <xs:documentation>...</xs:documentation> </xs:annotation> </xs:element> <xs:element name="StageOnDemand" type="xs:boolean" nillable="true" minOccurs="0"> <xs:annotation> <xs:documentation>...</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
it is derived from CoreObject:
<xs:complexType name="CoreObject"> <xs:sequence> <xs:element name="No" type="xs:int"> <xs:annotation> <xs:documentation>...</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType>
This is only a small part of the XSD, a much more complex type exists.
Therefore, when I generate classes similar to this , I get a generated class that has two more properties (in addition to 5, which I would expect):
public bool MinDuration_100msSpecified
and
public bool StageOnDemandSpecified
So, the property "Specified" was added to the "original" property, and now the type is bool. Can anyone explain why this is so?
derape
source share