I'm generating C# classes from an OTA (Open Travel Alliance) XSD file. You can download the XSD file from here.
I create the C# class with the following command in a Visual Studio Command Prompt:
xsd FS_OTA_VehLocDetailsNotifRQ.xsd /classes /nologo
Within OTA_VehLocDetailsNotifRQ.POS[0].RequestorID
I would expect to find an ID
property. Yet the property generated by the XSD.exe tool is named ID_Context
.
Can you explain why it does this, and whether I am able to force it to generate the correct (ID
) property name?
Please don't suggest I edit the generated file as that is not a maintainable approach.
Further edit after accepting the answer:
Looking at the XSD more closely and replacing the references with their attribute group definitions, the ID attribute can be seen in its attribute group:
<xs:attributeGroup name="UniqueID_Group">
<xs:attribute name="URL" type="xs:anyURI" />
<xs:attribute name="Type" type="OTA_CodeType" use="required" />
<xs:attribute name="Instance" type="StringLength1to32" />
<xs:attributeGroup name="ID_Group">
<xs:attribute name="ID" type="StringLength1to32" use="required" />
</xs:attributeGroup>
<xs:attribute name="ID_Context" type="StringLength1to32" use="optional" />
</xs:attributeGroup>
I believe this to be a bug in the XSD tool.