我想使用xjc生成一个新的java类,所以定义了一个schema。现在已有category的Java类,
需要在新生成的java类中使用已有的类,
不知道这段xml该如何定义?下面是我写的一段xml定义<xs:schema version="1.0"
targetNamespace="http://sample/common/services/pojos"
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:pj="http://sample/common/services/pojos" pj:version="1.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.1">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
<xs:annotation>
<xs:documentation>POJOs schema.</xs:documentation>
<xs:appinfo>
<jxb:globalBindings
collectionType="java.util.ArrayList"
fixedAttributeAsConstantProperty="false"
choiceContentProperty="false"
typesafeEnumMemberName="generateError"
enableFailFastCheck="false"
generateIsSetMethod="false"
underscoreBinding="asCharInWord">
<jxb:serializable />
</jxb:globalBindings>
</xs:appinfo>
</xs:annotation>
<!-- 需要重新定义的部分 -->
<xs:element name="category">
<xs:complexType>
<xs:sequence>
<xs:element name="sub" maxOccurs="unbounded" type="想要在这里定义已有的Java类"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
期待高人!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货