Re:JSONx is an IBM standard format to represent JSON as XML
by wereHamster on Tuesday September 23, 2014 @01:45PM
(#8356764)
Replace `xmlns:json="http://...` with `xmlns:j="http://...`.
Re:JSONx is an IBM standard format to represent JSON as XML
by moron4hire on Tuesday September 23, 2014 @01:57PM
(#8356879)
Actually, just remove the colon and the prefix entirely. It becomes surprisingly readable:
<object xsi:schemaLocation="http://www.datapower.com/schemas/json jsonx.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.ibm.com/xmlns/prod/2009/jsonx">
<string name="name">John Smith</string>
<object name="address">
<string name="streetAddress">21 2nd Street</string>
<string name="city">New York</string>
<string name="state">NY</string>
<number name="postalCode">10021</number>
</object>
<array name="phoneNumbers">
<string>212 555-1111</string>
<string>212 555-2222</string>
</array>
<null name="additionalInfo" />
<boolean name="remote">false</boolean>
<number name="height">62.4</number>
<string name="ficoScore"> > 640</string>
</object>
Re:JSONx is an IBM standard format to represent JSON as XML
by masklinn on Tuesday September 23, 2014 @01:45PM
(#8356769)
> On the plus side I bet the output gzip's up rather nicely in transit assuming you're HTTP GET'ting this data....
The XML is 901 bytes, gzip yields 401 (44.5%)
Of course the original JSON is 303 bytes and JSON is already pretty compressible, to 215 bytes (71%) in this case.
Re:JSONx is an IBM standard format to represent JSON as XML
by xienze on Tuesday September 23, 2014 @01:51PM
(#8356811)
> but why do I need to see the word json at the start and stop of every element?
Because of what I just mentioned. If they had set the root namespace directly you wouldn't have to declare the namespace prefix on every element.
Re:JSONx is an IBM standard format to represent JSON as XML
by colanderman on Tuesday September 23, 2014 @03:38PM
(#8357661)
I don't know why you were downvoted. Setting the root namespace provides exactly the effect of dropping "json:" from everything.
On the plus side I bet the output gzip's up rather nicely in transit assuming you're HTTP GET'ting this data....