ng5000 ng5000 - 28 days ago 7
C# Question

Generate class for schema with abstract complex type

I'm working with some schema which defines an abstract complex type, eg.

<xs:complexType name="MyComplexType" abstract="true">


This type is then referenced by another complex type in the schema:

<xs:complexType name="AnotherType">
<xs:sequence>
<xs:element name="Data" type="MyComplexType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>


When I run "xsd.exe /d /l:CS MySchema.xsd" I get this error:


Error: There was an error processing MySchema.xsd'.
- Error generating code for DataSet ''.
- Unable to convert input xml file content to a DataSet. DataSet cannot instantiate an abstract ComplexType for the node Data.
- DataSet cannot instantiate an abstract ComplexType for the node Data.


It doesn't seem to be invalid schema. Has anyone else run into this issue?

Thanks

Nick

Answer Source

After evaluating several different schema-to-code tools the only one we found that was able to deal with our schema (very large and extremely complicated) was Liquid XML (http://www.liquid-technologies.com/).