我有一段
<xs:attribute name="CardType" type="xs:string" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AX"/>
<xs:enumeration value="DC"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
结果用xjc运行时说[ERROR] src-attribute.4: Attribute 'CardType' has both a 'type' attribute and an
anonymous 'simpleType' child. Only one of these is allowed for an attribute. 还有一段
<xs:element name="MerchantDetail" Type = "MerchantInfo" minOccurs="1" maxOccurs="1" />,MerchantInfo是前面定义的一个complexType。
运行时说[ERROR] s4s-att-not-allowed: Attribute 'Type' cannot appear in element 'element'请问这是什么原因呢,难道jaxb不支持嵌套元素吗
<xs:attribute name="CardType" type="xs:string" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AX"/>
<xs:enumeration value="DC"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
结果用xjc运行时说[ERROR] src-attribute.4: Attribute 'CardType' has both a 'type' attribute and an
anonymous 'simpleType' child. Only one of these is allowed for an attribute. 还有一段
<xs:element name="MerchantDetail" Type = "MerchantInfo" minOccurs="1" maxOccurs="1" />,MerchantInfo是前面定义的一个complexType。
运行时说[ERROR] s4s-att-not-allowed: Attribute 'Type' cannot appear in element 'element'请问这是什么原因呢,难道jaxb不支持嵌套元素吗
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货