0

I have a complex structure of data, that can describe by HashMap inside HashMap. I need create XML file of structure. Like this:

<map>
    <key1>
        <map>
           <key1>someString1</key1>
           <key2>someString2</key2>
        </map>
    </key1>
    <key2>
        <map>
           <key1>someString1</key1>
           <key2>someString2</key2>
        </map>
    </key2>
</map>

But I noticed, JAXB has some problems with it. Is there any way to make XML from maps?

Ghosterus
  • 105
  • 1
  • 4

1 Answers1

1

You can not use JAXB to serialize directly a Map in to XML. You will have to use a Wrapper Class, that will serve you as the object tree. This link will help you.

Harry Coder
  • 2,429
  • 2
  • 28
  • 32