Apache Camel: XMLJSON conversion for empty tags to strings instead of arrays

给你一囗甜甜゛ 提交于 2019-12-10 17:15:33

问题


When using the Camel XMLJSON library and when converting an XML message to JSON using the unmarshal option. The application is converting the empty tags to empty JSON arrays. Is there a way to override this behavior to instead convert it into empty strings.

For example

<person>
<first_name>john</first_name>
<last_name/>
</person>

converts to

{
"first_name": "john",
"last_name": []
}

instead of the below

{
"first_name": "john",
"last_name": ""
}

How can this default behavior be overridden to provide the second output

来源:https://stackoverflow.com/questions/47056627/apache-camel-xmljson-conversion-for-empty-tags-to-strings-instead-of-arrays

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!