Sciology = Science + Technology

Commonsense in Technology

JSON2XML TreeViewer plugin for Eclipse

Posted by sureshkrishna on September 24, 2007

I have been working on the WEB2.0 platform from past one year. All the while i was looking out for simple plugins for eclipse to visualize and analyze the  json that either i built or got from server.

  • It is so much of a pain to really construct the JSON and then to debug to see if we have inserted the data at the right children.
  • When the complexity of the JSON grows, its difficult to see which are arrays and which are maps.
  • What if you need to test if the JSON is syntactically correct ? (of course we can send the request to  the server and get a response with a error header, but this is not what we want in most of cases)
  • When JSON is well formatted with the correct tabs it looks good else its a coffee-break time to see the JSON as formatted text

After looking at all these issues, i have written a small plugin to convert the JSON to XML and a Tree Response. This enables you to…

  • View the JSON as XML text
  • View JSON as Hierarchical Tree
  • Get immediate response if JSON is wrong.

http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-1071.html

http://sourceforge.net/project/showfiles.php?group_id=205573

I would love to get any of your feedback and response. I would be working on this plugin in the future, so your improvement request are well considered.

Advertisements

11 Responses to “JSON2XML TreeViewer plugin for Eclipse”

  1. Ed Merks said

    Suresh,

    I’ve been interesting if EMF could serialize instances using JSON as an alternative to XML and as a result I’ve been looking for information that describes how JSON handles the equivalent of xsi:type. I.e., what happens when I serialize a contained child that is of a derived type based on the type specified by the feature and hence will serialize additional properties that would not be expected just knowing the feature’s type. I.e., if I have a containment reference to a Person where a Person can either be a Man or a Woman, is there some standard way to represent the type of the Person as being either Man or Woman? What about references to objects contained elsewhere in the graph (like IDREF), is there a standard way for that?

  2. Ed,

    Actually thats a very interesting question. I have worked enough to say following things about the JSON and XML conversion stuff.
    * First things first : I dont see any single parser that would give a 100% true conversion between JSON and XML.
    * Its little uncertain how different parsers and utilities converts the attributes of the XML to JSON.
    e.g. and xml like

    gets converted to
    {“bla”:{“GlossSeeAlso”:[“GML”, “XML”]}}
    in the above case its not easy to serialize and retrieve the data.
    * As i see there are no standard way to identify the reference types in JSON. But i know of a way to write the custom parsers/wrappers to convert the XML JSON so that we can inject the Object Oriented behavior.
    So in that case we want to iudentify…
    the type of a reference
    definition of a referenced type
    * Last but not the least : JSON is a simple data exchnage format and currently i am not able to see a “standard” way of representing the “XMI” or OO Metadata.

    ~Krishna

  3. Jigar shah said

    Hi …i m trying to install this on eclipse3.3 and FC7 x86_64. I copied your jar into plugins directory. still does not work. Any plans for update site ? How do i solve this issue.

  4. Jigar: Thaks for coming back with questions.
    Please follow the mentioned steps and see how it behaves…
    # close the instances of the eclipse
    # copy the plugin jar file to plugins directory
    # For Your Information : In eclipse 3.3, unless its specified, plugin jars would not get expanded.
    # start the eclipse
    # go to Window -> Show View -> Other -> JSON View (click on the JSON2XML Viewer)
    # The JSON Viever should appear in the bottom area of the eclipse workbench.
    # If nothing happens or errors comes up, then please open Window -> Show View -> Other -> Pliugin development -> Error Log.
    # Copy the JSON View related exception and send it to me.

    Let me know if you have any questions.

  5. sebastian said

    Hi !

    Works great, just wanted to say “Thank You” !

    Greetings from Bonn, Germany,

    Sebastian

  6. Justin Grunau said

    Sadly, the json in a Firefox sessionstore.js file is too much for this plugin, even when you remove the surrounding parentheses. I just get:

    Error
    Tue Feb 12 16:53:32 EST 2008
    org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

  7. .jon said

    Very nice plugin. Any plans on enhancing, updating it? I would be very happy, if this could be changed to an editor, rather than a view only. An editor like the XML editor, where one can edit the XML as a tree or as text would be nice. So we could hand-craft complex JSON as tree. Maybe even XML->JSON would be nice.

  8. […] to XML By maohao A lightweight plugin for Eclipse. Works good for me on Flex Builder 3 […]

  9. adaptacja said

    adaptacja…

    […]JSON2XML TreeViewer plugin for Eclipse « Sciology = Science + Technology[…]…

  10. […]  3:Visual Studio 2005 的插件。      Eclipse 的json插件:JSON2XML TreeViewer plugin for Eclipse     这款插件主要功能是把json的数据转换为Json Tree和Xml […]

  11. Austin said

    I really tend to go along with every aspect that has been posted in
    “JSON2XML TreeViewer plugin for Eclipse | Sciology = Science + Technology”.
    I am grateful for all of the actual details.Thank you-Danilo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: