In package 1, I have a package info with elementFormDefault set to
qualified.
In a bean in package 1, I have an element decorated with:
@XmlElement(namespace="uri:org.apache.cxf.javascript.testns2")
That namespace corresponds to no package and no package-info.java.
Generated schema (from my favorite tool) for this extra schema is:
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns="uri:org.apache.cxf.javascript.testns2"
attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="uri:org.apache.cxf.javascript.testns2">
<xs:element name="intItem" type="xs:int"/>
<xs:element name="optionalStringItem" type="xs:string"/>
</xs:schema>
Back in the schema corresponding to 'package 1', I get the schema I'll
put at end.
As I read this, intItem should be unqualified. However, the JAXB 2.0
runtime seems to want qualification, since I get a default value
otherwise.
Howcome?
<xs:complexType name="testBean1">
<xs:sequence>
<xs:element form="qualified" minOccurs="0" name="stringItem"
type="xs:string"/>
<xs:element ref="ns1:intItem"/>
<xs:element default="43" form="qualified" name="longItem"
type="xs:long"/>
<xs:element form="qualified" minOccurs="0" name="base64Item"
type="xs:base64Binary"/>
<xs:element form="qualified" name="optionalIntItem" type="xs:int"/>
<xs:element minOccurs="0" ref="ns1:optionalStringItem"/>
<xs:element form="qualified" maxOccurs="unbounded" minOccurs="0"
name="optionalIntArrayItem" type="xs:int"/>
<xs:element default="-1.0" form="qualified" name="doubleItem"
type="xs:double"/>
<xs:element form="qualified" name="beanTwoItem" type="ns2:testBean2"/>
<xs:element form="qualified" minOccurs="0" name="beanTwoNotRequiredItem"
type="ns2:testBean2"/>
</xs:sequence>
</xs:complexType>