Live data from Hacker News

JSONx is an IBM standard format to represent JSON as XML

publib.boulder.ibm.com

41–50 of 80 posts

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

#42
post #25

Not sure what all the fuss is about. It's actually neat to have a common way of changing JSON to XML, think of a web service that offers an API using our beloved JSON. But wait, we also want to provide an XML API! Let's design our own, ad-hoc, crappy mapping or... use that thing that everyone else is using. XML is out there, has lots of tools and libraries and is actually useful for some things. Not to mention the ar…

"the fuss" is because a lot of people jumped on the JSON bandwagon in order to get away from XML.

Then wouldn't it make sense to allow people who are stuck using XML in some places to convert to JSON when talking to those that aren't stuck with XML?

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

#43
post #6
post #3

Why oh why... If it helps JSON invade the enterprise then ok, but why make a good thing bad.

http://publib.boulder.ibm.com/infocenter/wsdatap/v3r8m1/inde... To allow you to use XSLT tools apparently.

"Some people, when confronted with a problem, think 'I know, I'll XSLT.' Now they have two problems."

(edited for relevance)

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

#44
Not to go against the grain, but this could be useful. Say you already have some sort of datastore that uses xml. Now somebody hands you JSON for some reason, maybe a list of companies. Convert it to XML, stick it in your datastore and use XSL to do whatever you want with it.

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

#45
post #44

Not to go against the grain, but this could be useful. Say you already have some sort of datastore that uses xml. Now somebody hands you JSON for some reason, maybe a list of companies. Convert it to XML, stick it in your datastore and use XSL to do whatever you want with it.

XSLT is a scary language. It took several years for computer scientists to prove that it's Turing complete.

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

#47
post #14
post #9

"In an XML Firewall service, JSONx can be used like other XML input." http://publib.boulder.ibm.com/infocenter/wsdatap/v3r8m1/inde... "An XML firewall is a specialized device used to protect applications exposed through XML based interfaces like WSDL and REST and scan XML traffic coming in and out of an organization. [snipped] XML Firewall is often used to validate XML traffic, control access to XML based resources,…

Also, http://en.wikipedia.org/wiki/XML_appliance and http://www.layer7tech.com/products/xml-accelerator Astounding, is it not?

See also: http://en.wikipedia.org/wiki/Billion_laughs

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

#48
post #32

Earlier quoted context omitted.

XSLT and XPath is about the only reason I can see to use this. But, you know, how hard is: x.person.addresses[0].city? I guess XPath is easier when you probably have to do something like this: JSONObject json = (JSONObject) JSONSerializer.toJSON( jsonTxt ) String city = json.getJSONObject("person").getJSONArray("addresses").getJSONObject(0).getJSONObject("city"); Or however you'd do it in Java.

That's not hard, what's hard is //person[@alive="true"]/pets//dog[@hair="long"]/*/flea[@name]

still, i think an xpath evaluator for json would have been the way to go here instead

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

#49
post #12

Reminds me of the Property List evolution: 1. "Under NeXTSTEP, property lists were designed to be human-readable and edited by hand, serialized to ASCII in a syntax somewhat like a programming language." 2. "In Mac OS X 10.0, the NeXTSTEP format was deprecated, and a new XML format was introduced." 3. "Since XML files, however, are not the most space-efficient means of storage, Mac OS X 10.2 introduced a new format w…

Everything converges to the equivalent of protocol buffers. Property lists -> XML -> Binary Property Lists JSON -> JSON Schema -> Binary JSON XML -> XML Schema -> XML Namespaces -> Binary XML Or you can skip all that faffing around and just jump straight to protocol buffers. :) ps. Protocol Buffers have a text format too that looks very similar to JSON. And you can encode protocol buffers as JSON, though I'm not sure…

Similarly you could use Doug Cutting's Avro format that does have a JSON representation. It is also evolvable like Protocol Buffers and works well in untyped languages. I highly recommend it.
Post reply on HN