Community
Participate
Working Groups
Created attachment 187455 [details] source for schema gen Take the following example (see attachment for more): @XmlType public class EmploymentPeriod { @XmlElement public MyDate startDate; @XmlElement public MyDate endDate; } @XmlType(namespace="http://www.w3.org/2001/XMLSchema", name="date") public class MyDate { @XmlValue public String value; } The reference implementation generates the following schema snippet: <xs:complexType name="employmentPeriod"> <xs:sequence> <xs:element name="startDate" type="xs:date" minOccurs="0"/> <xs:element name="endDate" type="xs:date" minOccurs="0"/> </xs:sequence> </xs:complexType> where "xs" refers to the schema for schema namespace. MOXy generates the following schema snippet: <xsd:import schemaLocation="schema1.xsd" namespace="http://www.w3.org/2001/XMLSchema"/> <xsd:complexType name="employmentPeriod"> <xsd:sequence> <xsd:element name="startDate" type="ns1:date" minOccurs="0"/> <xsd:element name="endDate" type="ns1:date" minOccurs="0"/> </xsd:sequence> </xsd:complexType> where "ns1" refers to the imported schema, which is also generated thusly: <xsd:simpleType name="date"> <xsd:restriction base="xsd:string"/> </xsd:simpleType>
Created attachment 188347 [details] Proposed fix.
Created attachment 188348 [details] Supporting test case.
Reviewed by: blaise.doughan@oracle.com Tests: all unit tests pass as expected; jaxb/xmltype/XmlTypeTestsCases Revision: 8938
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink