Parsing XML to a Java object, clarification needed
What would be the best way to stick this XML into an object?
<root>
<data value=1>
<cell a='1' b='0'/>
<cell a='2' b='0'/>
<cell a='3' b='0'/>
</data>
<data value=2>
<cell a='2' b='0'/>
<cell a='4' b='1'/>
<cell a='3' b='0'/>
</data>
</root>
We can assume that
Each data value will be unique.
Actual numeric value assigned to it is important and needs to be captured
Is it possible to put this into Map<Integer, List<Cell>>, grouping cells
under the data value?
Ideally method signature would look as follows public static Map<Integer,
List<Cell>> parse(String pathToFile)
Would you provide an example please?
No comments:
Post a Comment