Wednesday, January 18, 2017

Convert between XML and JSON documents and schema

XML and JSON Conversion Tools

Liquid Studio 2017 allows you to convert between XML Schema, XML Documents, JSON Schema and JSON Documents using a number of inbuilt tools.

Graphical XML Schema (XSD) View

The image shows the Graphical XML Schema (XSD)Designer displaying the 'Bookstore.xsd' sample, which is provided as part of the default project in Liquid Studio 2017.

As you can see, it has a convenient split view screen showing both the logical (Design) and physical (Source) views of the document.



Create Sample XML Document Tool

The right click menu has the option to 'Create Sample XML from Item. You can also use the main Tools menu.

Selecting this menu option runs a Wizard which allows you to configure how the tool should create the sample. E.g. You can choose how optional items are handle, choose to ignore errors, and select which namespaces are used.


Graphical XML Document View

When the tool has completed, the new XML document is displayed.

Again a split view is shown and you can choose to display just the Graphical Design view, just the Source text view, or a split view showing both.

Convert XML to JSON Tool

When you have an XML document open, you can select the File->Export As JSON File option.

This will display an export JSON dialog allowing you to select how the JSON file should be saved.

JSON Editor

You can then open the new JSON file in Liquid Studio 2017.

The JSON file is displayed in Source form and the editor provides formatting functionality, collapsible regions.

Infer JSON Schema Tool

When you have a JSON document open, you can select the Tools->Infer JSON Schema menu option. This will display a dialog allowing you to set option regarding how the JSON schema should be created.

Graphical JSON Schema Editor

The new JSON Schema is displayed in the graphical JSON Schema Editor. This has the options to view a split screen showing both the logical and source views.


Summary

We have provided a brief overview of the tools available in Liquid Studio 2017, but several other conversion utilities are also included.
  • Create Sample XML Document Tool
  • Infer XML Schema Tools
  • Create Sample JSON Document Tool
  • Infer JSON Schema
  • Export XML as Fast Infoset
  • Export XML as JSON
  • Export JSON as XML
  • Import Fast Infoset as XML
  • Import JSON as XML
  • Import XML as JSON
  • Convert DTD to XSD

Download a free trial of Liquid XML Studio to experience the full functionality of these tools and much more.