Given the following two schemas
(Root)
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:someNs="first" xmlns:someOtherNs="second"
xmlns:xsd="http://ift.tt/tphNwY" elementFormDefault="unqualified"
attributeFormDefault="unqualified" version="1.0" targetNamespace="first">
<xsd:import namespace="second" schemaLocation="./child.xsd" />
<xsd:element name="employee" type="someNs:fullpersoninfo" />
<xsd:complexType name="personinfo">
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string" />
<xsd:element name="lastname" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="fullpersoninfo">
<xsd:complexContent>
<xsd:extension base="someNs:personinfo">
<xsd:sequence>
<xsd:element name="address" type="xsd:string" />
<xsd:element name="city" type="xsd:string" />
<xsd:element name="country" type="xsd:string" />
<xsd:group ref="someOtherNs:Child" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
and (child)
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="someId-1" targetNamespace="second"
elementFormDefault="qualified" xmlns:someOtherNs="second"
xmlns:xs="http://ift.tt/tphNwY" xmlns="second">
<xs:element name="ChildElement" type="ChildElement"
nillable="false" />
<xs:complexType name="ChildElement">
<xs:sequence>
<xs:element name="firstname" type="xs:string" />
<xs:element name="lastname" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:group name="Child">
<xs:sequence>
<xs:element ref="ChildElement" minOccurs="0" maxOccurs="1" />
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"
namespace="##other" />
</xs:sequence>
</xs:group>
</xs:schema>
a Unique particle attribution should not be present as the child uses elementFormDefault="qualified"
and the root uses elementFormDefault="unqualified"
. However, when run through Java's xjc, it is not possible to use the generated classes as the annotations on the classes seems to be insufficient - at least it seems. How can the UPA be avoided?
No comments:
Post a Comment