I'm converting map to xml using XStream's NamedMapConverter but the root element is always <map>
.
I cannot find a way to change it. Is it possible and how?
Asked
Active
Viewed 323 times
0

J.Doe
- 287
- 1
- 5
- 16
-
In this URL: https://stackoverflow.com/questions/32296215/xstream-serialize-custom-map-with-namedmapconverter, there is a `XStream xs = new XStream(); xs.alias("base", Base.class);`. Maybe this helps. – Kosonome Feb 28 '20 at 17:17
-
Also, you need put some more code to people help you, check that: https://stackoverflow.com/help/how-to-ask – Kosonome Feb 28 '20 at 17:19
-
Why don't you use Jackson instead. Check this thread https://stackoverflow.com/questions/3941479/jaxb-how-to-marshall-map-into-keyvalue-key – Victor Gubin Feb 28 '20 at 17:56
1 Answers
0
Actually it seems the only thing that's needed to change the root tag name is set
xStream.alias("your_root_tag_name", Map.class);

J.Doe
- 287
- 1
- 5
- 16