我是 XML 和 JAXB 的新手,我正在尝试将 AdditionalDataDeposit 字段添加到我的 XML 架构中,这样我就可以使用 Maven 生成 POJO。当我尝试在 Maven 中构建它时出现错误:
blahBlahBlahmsgfactory: Unable to parse input schema(s). Error messages should have been provided.
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name
'LimitedString50' to a(n) 'type definition' component.
我的代码:
在 AdditionalData 复杂类型下:
<xs:element name="DEPOSIT" type="trmns:AdditionalDataDEPOSIT" minOccurs="0">
<xs:annotation>
<xs:documentation>Additional Deposit Data</xs:documentation>
</xs:annotation>
</xs:element>
然后:
<xs:complexType name="AdditionalDataDEPOSIT">
<xs:annotation>
<xs:documentation>Additional Deposit Data</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="depositorID" type="LimitedString50"/>
<xs:element name="depositorNationality" type="LimitedString50"/>
<xs:element name="fundSource" type="LimitedString50"/>
<xs:element name="fullName" type="LimitedString100"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="LimitedString50">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="LimitedString100">
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
我不太了解 XML Schema,但我们将不胜感激。