-
After generating an xml string from a Json string I see a lot of "descriptors" in some of the tags e.g.
Is there a way to remove the array="true" part? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi @ryserCar, Thank you for your question. I may add a new mode FORCE_REMOVE_ARRAY_ATTRIBUTE_JSON_TO_XML in U.jsonToXml() method. Will it be good for you? |
Beta Was this translation helpful? Give feedback.
-
The new mode was added #349. I will check how to exclude type xml prefixes. |
Beta Was this translation helpful? Give feedback.
-
I added a new mode assertEquals(
assertEquals(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<root>\n"
+ " <data>\n"
+ " <a>b</a>\n"
+ " <c>true</c>\n"
+ " <d>1</d>\n"
+ " <e></e>\n"
+ " <f>null</f>\n"
+ " </data>\n"
+ " <data2>true</data2>\n"
+ " <data2>1</data2>\n"
+ " <data2>null</data2>\n"
+ "</root>",
U.jsonToXml(
"{\n"
+ " \"data\": [\n"
+ " {\n"
+ " \"a\": \"b\",\n"
+ " \"c\": true,\n"
+ " \"d\": 1,\n"
+ " \"e\": {},\n"
+ " \"f\": null\n"
+ " }\n"
+ " ],\n"
+ " \"data2\": [\n"
+ " true,\n"
+ " 1,\n"
+ " null\n"
+ " ]\n"
+ "}",
U.JsonToXmlMode.REMOVE_ATTRIBUTES)); |
Beta Was this translation helpful? Give feedback.
I added a new mode