Community
Participate
Working Groups
There are currently a couple of @XmlValue use cases that are not supported by MOXy: USE CASE #1 - @XmlAttribute on POJO property MOXy is not correctly handling @XmlValue when it is reference by a property annotated with @XmlAttribute. For an example see example 5 at the following link: - http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/annotation/XmlType.html USE CASE #2 - Changed @XmlValues Issue sent in via email: In the RI, the output element has the value of the inner text. In MOXy I get a rather strange output: <top><middle><text()>Some Value</text()></middle></top> When Iām expecting <top><middle>Some Value</middle></top> In this case I have the following three classes: @XmlRootElement public class Top { @XmlElement public Middle middle; public String toString() { return "Top(" + middle + ")"; } } public class Middle { @XmlValue public Bottom bottom; public String toString() { return "Middle(" + bottom + ")"; } } public class Bottom { @XmlValue public String value; public String toString() { return "Bottom(" + value + ")"; } } And the following testing harness: JAXBContext c = JAXBContext.newInstance(Top.class); System.err.println(c.getClass()); Marshaller m = c.createMarshaller(); Top t = new Top(); t.middle = new Middle(); t.middle.bottom = new Bottom(); t.middle.bottom.value = "Some Value"; FileOutputStream out = new FileOutputStream("c:\\temp\\t.xml"); m.marshal(t, out); out.close(); Unmarshaller u = c.createUnmarshaller(); Top tu = (Top) u.unmarshal(new File("c:\\temp\\t.xml")); System.err.println(tu);
*** Bug 367795 has been marked as a duplicate of this bug. ***
*** Bug 367323 has been marked as a duplicate of this bug. ***
Created attachment 209277 [details] MOXy - Test Cases (2.3.3)
Created attachment 209278 [details] Core - Fix
Created attachment 209284 [details] MOXy - Test Cases (trunk)
Created attachment 209285 [details] Core - Fix (Trunk)
Created attachment 209286 [details] Core - Fix (2.3.3)
Fix checked into 2.3.3 at rev: 10676 Code reviewed by: Denise Smith Fix Details: - Composite objects mapped with @XmlValue are now treated as self records. - Composite objects mapped with @XmlAttribute are now handled by specialized code in XMLCompositeObjectMappingNodeValue - Code takes into account XMLConversionManager, XmlAdapter, and @XmlInverseReference.
Created attachment 210073 [details] Core - Fix (Trunk)
Created attachment 210074 [details] MOXy - Test Cases (trunk)
Fix checked into trunk at rev: 10741 Code reviewed by: Denise Smith Fix Details: - Composite objects mapped with @XmlValue are now treated as self records. - Composite objects mapped with @XmlAttribute are now handled by specialized code in XMLCompositeObjectMappingNodeValue - Code takes into account XMLConversionManager, XmlAdapter, and @XmlInverseReference.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink