How to unmarshal xml with repetitive entries using JAXB and Spring



I have to convert xml to Map<String,String>. I have following XML structure:



<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Environments>
<Environment Name="A" URIPath="http://a.com" />
<Environment Name="B" URIPath="http://b.com" />
<Environment Name="C" URIPath="http://c.com" />
</Environments>


I tried multiple ways but eneded with Class has two properties of the same name "URIPath". What is the right design for unmarshalling this XML?


No comments:

Post a Comment