And now the next trick I will perform is turning XML into JSON
buddy of mine made JSHOL on a whim which creates html from json
41–50 of 68 posts
And now the next trick I will perform is turning XML into JSON
buddy of mine made JSHOL on a whim which creates html from json
Why?
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.
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…
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.
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 ?
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.
Why?
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".
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.
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…
Oh good, you can convert it back to JSON with an XSLT.
XSLT really is the seventh circle of Hell.