Re:JSONx is an IBM standard format to represent JSON as XML
by ericmoritz on Friday April 29, 2011 @05:58PM
(#2499162)
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.
Re:JSONx is an IBM standard format to represent JSON as XML
by wulczer on Friday April 29, 2011 @06:33PM
(#2499258)
That's not hard, what's hard is
//person[@alive="true"]/pets//dog[@hair="long"]/*/flea[@name]
Re:JSONx is an IBM standard format to represent JSON as XML
by catshirt on Friday April 29, 2011 @08:07PM
(#2499488)
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
by Stormbringer on Friday April 29, 2011 @06:35PM
(#2499259)
You appear to be confusing Java and Javascript.
JSON stands for Javascript Object Notation.
In Java the equivalent would simply be serialization.
NB: if XSLT and XPath is the solution, you've already lost.
To allow you to use XSLT tools apparently.