I hope it's not a duplicated question, I was looking for an answer for my simple question but I couldn't find anyhting. I need to convert json to xml using the underscore java library and this is quite easy using U.jsonToXml method. My problem is when I need to create node with value and attribute.
What I can do:
<some_root>
<ABC some_attribute="attribute">
<another_tag>some_value</another_tag>
</ABC>
</some_root>
What I need is:
<some_root>
<ABC some_attribute="attribute">some_value</ABC>
</some_root>
I was trying different things, playing around with arrays or with self-closing-tag, looking at the gh repo but I couldn't get the node with parameters and value:
"{\"ABC\":{\"-attr\":\"c\", \"value\": \"test\"}}"
"{\"ABC\":{\"-attr\":\"c\", \"-value\": \"test\"}}"
Is there any way to do this? Thanks for your help.
The example with XML transformation: