Live data from Hacker News

JSONx is an IBM standard format to represent JSON as XML

pic.dhe.ibm.com

11–20 of 68 posts

Re: JSONx is an IBM standard format to represent JSON as XML

#15
post #9
post #7

Earlier quoted context omitted.

It would look a lot more reasonable if they had set the root namespace instead of leaving it separate and requiring every element to be prefixed.

Yep. The rest of it is, well, xml, and it's not going to be as clean looking as json , but why do I need to see the word json at the start and stop of every element? It could at least be abbreviated to just 'j'? On the plus side I bet the output gzip's up rather nicely in transit assuming you're HTTP GET'ting this data....

Replace `xmlns:json="http://...` with `xmlns:j="http://...`.

Re: JSONx is an IBM standard format to represent JSON as XML

#17
post #9
post #7

Earlier quoted context omitted.

It would look a lot more reasonable if they had set the root namespace instead of leaving it separate and requiring every element to be prefixed.

Yep. The rest of it is, well, xml, and it's not going to be as clean looking as json , but why do I need to see the word json at the start and stop of every element? It could at least be abbreviated to just 'j'? On the plus side I bet the output gzip's up rather nicely in transit assuming you're HTTP GET'ting this data....

> 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

#18
post #2

From the department-of-redundancy-department.... The output syntax is even more glorious than you'd think: http://www.datapower.com/schemas/json jsonx.xsd" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:json=" " rel="nofollow">http://www.ibm.com/xmlns/prod/2009/jsonx"> John Smith 21 2nd Street New York NY 10021 212 555-1111 212 555-2222 false 62.4 > 640 ...and no, I'm not joking, and don't call me Shirl…

But what if the original JSON had a string that looks like XML? Does {"endTag": ""} become ?

Re: JSONx is an IBM standard format to represent JSON as XML

#20
post #18
post #2

From the department-of-redundancy-department.... The output syntax is even more glorious than you'd think: http://www.datapower.com/schemas/json jsonx.xsd" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:json=" " rel="nofollow">http://www.ibm.com/xmlns/prod/2009/jsonx"> John Smith 21 2nd Street New York NY 10021 212 555-1111 212 555-2222 false 62.4 > 640 ...and no, I'm not joking, and don't call me Shirl…

But what if the original JSON had a string that looks like XML? Does {"endTag": " "} become ?

Of course not, it's either embedded in a CDATA section or the characters are escaped to the relevant entities: http://www.w3.org/TR/xml/#syntax

> The ampersand character (&) and the left angle bracket () may be represented using the string " > ", and must, for compatibility, be escaped using either " > " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.

Post reply on HN