Hello all,
I need your help please. I’m generating an XML file using JAXB. The client request that I need to do is, when retrieving data (from data base) to set into JAXB objects I have to check one of the element values.
For example:
<id>123</id>
<Code>X22</Code>
<location>A1-2-3</location>
If the location value is as the above I have to change it to A1, A2 and A3 and set to location attribute cloning the block like example below.
First copy
<id>123</id>
<Code>X22</Code>
<location>A1</location>
Second copy
<id>123</id>
<Code>X22</Code>
<location>A2</location>
Third copy
<id>123</id>
<Code>X22</Code>
<location>A3</location>
All values stored in City object with getters and setters. The location type is String.
And set it into the same XML. My problem is that I can copy the blocks, but when I’m changing the location value it changes in all blocks, as I’m a beginner so please, help me if you can.
Many Thanks in advance.