开发者

xml<-->json converter which preserves types

开发者 https://www.devze.com 2023-03-20 01:35 出处:网络
I need an xml<-->json converter which preserves types. For example: json: \"number\": 1 to xml: <number>1</number>

I need an xml<-->json converter which preserves types. For example:

json:

"number": 1

to xml:

<number>1</number>

back to json:

"number": 1

the converters I've found so far will return back to json like this:

"number": "1"

(a string semantics and not int)

Of course I understand the semantics is lost in the translation. I wonder if any converter tried to preserve the type on the xml like this:

<n开发者_JAVA百科umber xsi:type="s:int">1</number>

or to use xml schema etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消