生成类抽象复杂类型的架构抽象、架构、复杂、类型

2023-09-03 06:01:12 作者:生如夏花

我正在与一些架构定义了一个抽象的复杂类型,如:

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>

当我运行XSD.EXE / D / L:CS MySchema.xsd我得到这个错误:

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

错误:有一个错误处理MySchema.xsd。      - 错误发生code为数据集'。      - 无法输入xml文件内容转换为数据集。数据集不能实例化一个抽象的ComplexType该节点的数据。      - 数据集不能实例化一个抽象的ComplexType为节点的数据。

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?

感谢

尼克

推荐答案

评估几种不同的模式,于─code工具,我们发现,能够处理我们的模式是唯一一个后(非常大,非常复杂)是液体的XML( http://www.liquid-technologies.com/ )。

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/).