JAXB: umarshaling mixed xml elements



I have a similar problem. I have a similar XML, like this:



<?xml version="1.0" encoding="UTF-8"?>
<root>
<y>1</y>
<x>A</x>
<x>B</x>
<x>C</x>

<y>2</y>
<x>D</x>
<x>E</x>
<x>F</x>

<y>3</y>
<x>I</x>
<x>J</x>
<x>L</x>
...
</root>


But, I need that my result to be:



Object root
List<SetNumber> entries
- y
- List<X> x;


I need to get together the set of <y> and <x>'s (in this case, three elements) in a new element (for example, SetNumber).


Another problem is that the list of <x> is dynamic. The XML can take any amount of (greater than one).


No comments:

Post a Comment