gpt4 book ai didi

grails - xsd 逆向工程抛出未知类型

转载 作者:行者123 更新时间:2023-12-02 21:04:50 25 4
gpt4 key购买 nike

正在使用 grails 的 xsd-reverse-enginering 插件,遇到了一些问题,我想我知道它是什么,但不知道如何解决它。

有一个包含相对高级模式的巨大 xsd 文件,我想尝试看看是否可以通过让 grails 从它创建 gorm 对象来节省大量时间。问题在于制作 xsd 文件的机构根据数据内容命名了许多 XML 类型。例如,它们有一个名为 MessageType 的元素

        <xs:element name="MessageCategory" type="MessageType" id="S1.1">
<xs:annotation>
<xs:documentation>The type of message: either an original Submission (NewSubmission), an update on a submission (SubmissionVariation), a complete replacement of one message with another (SubmissionReplacement) or submission that should not have been sent (SubmissionVoid) that should be effectively deleted.</xs:documentation>
</xs:annotation>
</xs:element>

这会引发以下错误

Unknown simpleType: MessageType  

关于如何管理这个的任何想法,例如我可以定义类型或其他东西吗?

最佳答案

如果您想声明此类型,您应该以正确的方式定义类型标签(如下所述: http://msdn.microsoft.com/en-US/library/8w07bk3h%28v=vs.80%29.aspx )

例如:一个简单的类型定义(如数字)

<xs:simpleType name="MessageType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>

复杂类型定义(称为元素)

<xs:element name="MessageType">

<xs:simpleType ...>
</xs:simpleType>

<xs:simpleType ...>
</xs:simpleType>

</xs:element>

关于grails - xsd 逆向工程抛出未知类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26754465/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com