Community
Participate
Working Groups
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);
Created attachment 208964 [details] MOXy - Test Cases
Created attachment 208965 [details] Core - Fix
*** This bug has been marked as a duplicate of bug 368283 ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink