[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] Binder issue with @XmlElements
|
Hi,
I try to use EclipseLink XML binder to keep xml comments. I try this sample
http://bdoughan.blogspot.com/2010/09/jaxb-xml-infoset-preservation.html#comment-form,
it works very fine.
But if i use @XmlElements in my class for example:
@XmlRootElement(name = "Customer")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"items"
})
public class Address {
@XmlElements({
@XmlElement(name="A", type=Integer.class),
@XmlElement(name="B", type=Float.class)
})
public List items;
//I remove get and set methods
}
When I call binder.updateXML method (to synchronise Java objects with my XML
file), comments don't move, but tags moves after their root tag:
- Input XML:
<customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<address>
<A>1</A>
<!-- comments 2 -->
<A>2</A>
</address>
- Output XML:
<customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<address><A>1</A><A>2</A>
<!-- comments 2 -->
</address>
So there isn't synchronisation between my XML file and DOM, comments don't
move, but tags moves !!! Tags musn't move. I don't understand why ? Maybe an
issue with ma declaration of @XmlElements in my class Address ? (It's
generated by xjc from an <xs:choice .../> ). Or it's a bug ?
Thanks in advance if you can help me !
Tibo
--
View this message in context: http://old.nabble.com/Binder-issue-with-%40XmlElements-tp30055797p30055797.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.