Live data from Hacker News

JSONx is an IBM standard format to represent JSON as XML

pic.dhe.ibm.com

21–30 of 68 posts

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

#21
Wait, this can't be right for purely technical reasons: what would this to do a string containing vertical tab characters?

Such strings are illegal in XML. I see nothing in the "JSONx Conversion Rules" that addresses the problem that the strings representable in XML are a smaller set than those in JSON.

[edit] Yup, confirmed. The documentation says: "The \b (backspace) and the \f (form feed) characters are not supported in XML and, subsequently, are not supported in JSONx." So not only does this JSON->XML thing seem obtuse, but it's partial.

I wrote a rant about this point a few days ago. Seems more well timed than I had hoped. https://plus.google.com/117593568781545916065/posts/ViNzo5Jj...

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

#24
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....

> 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

#25
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…

[deleted]

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

#26
post #5
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…

I don't think JSONx is built for readability, so that actually seems like a very reasonable way to convert to XML.

I've never understood the reasoning behind using a textual serialization format that's not human readable.

If you don't want it to be readable, make the darn thing binary and go for efficiency.

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

#27
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…

Not sure what you mean, the result looks fairly restrained to me.

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

#28
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 ?

They'd probably escape out the angle brackets with entities. Sorry, Bobby Tables.

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

#30
post #5

Earlier quoted context omitted.

I don't think JSONx is built for readability, so that actually seems like a very reasonable way to convert to XML.

I've never understood the reasoning behind using a textual serialization format that's not human readable. If you don't want it to be readable, make the darn thing binary and go for efficiency.

There's a difference between prioritizing readability and simply being readable.
Post reply on HN