Live data from Hacker News

JSONx is an IBM standard format to represent JSON as XML

pic.dhe.ibm.com

41–50 of 68 posts

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

#43
post #12

Why?

Same reason as SOAP/WSDL: there's good money in consulting so it would be stupid to do something that to simple, people might be able to solve their own problems.

Honestly I get that there an advantage in respect to tooling and this might ease integration into existing system, but I can't help feel that this is introducing an extra level of complexity that you would only find acceptable if you at IBM customer level scale.

The ability to introduce at least some type safety seems nice though.

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

#44

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 suppor…

> So not only does this JSON->XML thing seem obtuse, but it's partial.

If it wasn't partial, it would be useful -- allowing existing XML tools to easily consume and/or produce JSON tools by applying a JSON -> XML on input and/or XML -> JSON on output would be valuable.

But when the conversion is restricted to an XML-1.0-compatible-subset of JSON, the value drops considerably.

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

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

I don't really understand why you are being down voted for a technical question. It seems like answering it without giving a downvote as a snarky "ISN'T IT OBVIOUS?" would be sufficient.

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

#46
post #6
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.

yeah, the point isn't so much to make it readable, but to allow you to write JSON (as a python dev I love the interoperability with JSON) and then use the capabilities of the DataPower to do stuff with it. I expect many people were doing this by hand since JSON has replaced XML in a lot of peoples minds, and IBM has created a way to standardize it to make it easier to work with other teams.

That doesn't make this mess any saner, if the point was to apply XML tools to JSON, why not convert to an existing XML dialect with equivalent expressive power, e.g. XMLRPC's serialisation format (which provides a strict superset of JSON capabilities (if you include the nil extension))?

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

#47
post #12

Why?

To use existing XML 1.0 tools on data that comes in as JSON.

It may be somewhat problematic that it doesn't actually support all JSON, because the characters that are permitted (even with escapes) in XML 1.0 text do not include all characters that can appear in JSON values, so if you use it on legal JSON that isn't constrained to be XML 1.0 compatible, it will do something wrong (the docs aren't clear on whether it will fail or just drop the offending characters), so the only place that it seems safe to use is in a constrained internal environment where you control "JSON" to mean "JSON using XML-1.0-safe characters".

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

#48
post #31

This is SO SO important. I've had to convert JSON to XML and vice versa so many times in order to transfer data to and from legacy code components. No, I don't think an ideal world involves any sort of communication where one side speaks JSON and the other speaks XML, but the current world very much needs a standardization like this.

Insofar as the world needs a JSON->XML conversion standard, it needs one that handles all legal JSON, which this doesn't (it could if it used the same approach to target XML 1.1 instead of XML 1.0, or it could if it used a slightly more complex representation of JSON strings in the XML 1.0, but instead it chose to be a conversion for a restricted XML-1.0-friendly subset of JSON.)

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

#49
post #12

Why?

To use existing XML 1.0 tools on data that comes in as JSON. It may be somewhat problematic that it doesn't actually support all JSON, because the characters that are permitted (even with escapes) in XML 1.0 text do not include all characters that can appear in JSON values, so if you use it on legal JSON that isn't constrained to be XML 1.0 compatible, it will do something wrong (the docs aren't clear on whether it w…

This. I'm not claiming it is a good idea... But, DataPower is a highly optimized data processing network appliance for XML. It provides transform speeds with minimal latency, etc. So, to extend its capabilities to a new popular data format (JSON), they transform JSON to XML.
Post reply on HN