Community
Participate
Working Groups
For the class; @XmlRootElement @XmlType(propOrder = {"id", "name", "phoneNumbers"}) @XmlAccessorType(XmlAccessType.FIELD) public class Customer { private String id; private String name; @XmlJavaTypeAdapter(LinkAdapter.class) @XmlPath("atom:link[@rel='phone']/@href") private List<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>(); } The following XML schemas are incorrectly generated: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import schemaLocation="schema2.xsd" namespace="http://www.w3.org/2005/Atom"/> <xsd:complexType name="customer"> <xsd:sequence> <xsd:element name="id" type="xsd:string" minOccurs="0"/> <xsd:element name="name" type="xsd:string" minOccurs="0"/> <xsd:element ref="atom:link" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:element name="customer" type="customer"/> </xsd:schema> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:ns0="http://www.w3.org/2005/Atom" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2005/Atom"> <xsd:element name="link"> <xsd:complexType> <xsd:sequence/> <xsd:attribute name="href"> <xsd:simpleType> <xsd:list itemType="xsd:string"/> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="rel" type="xsd:string"/> </xsd:complexType> </xsd:element> </xsd:schema> The XML schemas should look like: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import schemaLocation="schema2.xsd" namespace="http://www.w3.org/2005/Atom"/> <xsd:complexType name="customer"> <xsd:sequence> <xsd:element name="id" type="xsd:string" minOccurs="0"/> <xsd:element name="name" type="xsd:string" minOccurs="0"/> <xsd:element ref="atom:link" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:element name="customer" type="customer"/> </xsd:schema> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:ns0="http://www.w3.org/2005/Atom" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2005/Atom"> <xsd:element name="link"> <xsd:complexType> <xsd:sequence/> <xsd:attribute name="href" type="xsd:string"/> <xsd:attribute name="rel" type="xsd:string"/> </xsd:complexType> </xsd:element> </xsd:schema> Additional Info: public class LinkAdapter extends XmlAdapter<String, Object> { ... }
Created attachment 215095 [details] Patch - code changes
Created attachment 215096 [details] Patch - new tests
Created attachment 215097 [details] Patch - changes to existing test cases
Created attachment 215098 [details] Patch - new tests
Attached patch checked into SVN into 2.4 and Trunk streams. Reviewed by Blaise Doughan
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink