JSON2XML TreeViewer plugin for Eclipse

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.

This entry was posted in eclipse, java, plugins. Bookmark the permalink.

0 Responses to JSON2XML TreeViewer plugin for Eclipse

  1. Ed Merks says:

    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 says:

    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 says:

    Hi !

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

    Greetings from Bonn, Germany,

    Sebastian

  6. Justin Grunau says:

    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 says:

    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. Pingback: JSON to XML « :maohao:

Leave a Reply

Your email address will not be published. Required fields are marked *