Sunday, 7 December 2014

What is the best way convert XML to Map in Java in specific format?



I have the XML file in following format. Number of tags and nested hierarchy are randomly



<a>0
<b>1
<c>2
<d>3
<e>4</e>
</d>
<d>5
<e>6</e>
<e>7</e>
<e>8</e>
</d>
<d>9
<e>10</e>
</d>
</c>
</b>
<b>11
<c>12
<d>13
<e>14</e>
</d>
</c>
<c>14
<d>15
<e>16</e>
</d>
</c>
</b>
</a>


I would like to parse it to get the next data sets:



0,1,2,3,4
0,1,2,5,6
0,1,2,5,7
0,1,2,5,8
0,1,2,9,10
0,11,12,13,14
0,11,14,15,16


In other words - each a,b,c,d,e nested combination.


No comments:

Post a Comment