Monday, May 14, 2018

JSON Data Binding with Liquid XML 2018 – Update 1

XML to JSON and JSON to XML the smart way


Liquid XML Data Binder has helped developers work with XML for nearly 20 years. In more recent times passing data between heterogeneous systems, specifically backend to mobile devices, has become increasingly reliant on using JSON data structures.

In order to facilitate this, we have introduced the FromJson and ToJson set of methods to the Liquid Runtime API which will serialize and deserialize JSON data to and from the generated data objects.

Supported languages are C++, C#, Visual Basic .Net and Java.

C# Example

    // create an instance of the class to load the XML file into
    Bookstore elm = new Bookstore();
                    
    // load the initial XML data from a file into the object
    elm.FromXmlFile(filename);

    // change the price of the first book to 10.99
    elm.BookCol[0].Price = 10.99;
    
    // extract the updated data into an XML string
    string strXml = elm.ToXml();
    Console.WriteLine($"The XML created\n{strXml}");
    
    // extract the updated data into a JSON string
    string strJson = elm.ToJson();
    Console.WriteLine($"The JSON created\n{strJson}");

C++ Example

    // create an instance of the class to load the XML file into
    CBookstorePtr spElm = CBookstore::CreateInstance();
    
    // load the initial XML data from a file into the object
    spElm ->FromXmlFile(lpctFilename);
    
    // change the price of the first book to 10.99
    spElm->GetBookCol()->Item(0)->SetPrice(10.99);

    // extract the updated data into an XML string
    std::tstring strXml = spElm ->ToXml();
    _tprintf(_T("The XML created\n%s"), strXml.c_str());
    
    // extract the updated data into a JSON string
    std::tstring strJson = spElm ->ToJson();
    _tprintf(_T("The JSON created\n%s"), strJson.c_str());

The XML created

    <bs:bookstore xmlns:bs="http://www.liquid-technologies.com/sample/bookstore">
                   xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
      <bs:book price="10.99" publicationdate="2008-10-20" ISBN="978-0747596837">
      <bs:title>The Graveyard Book</bs:title>
      <bs:author>
        <bs:first-name>Neil</bs:first-name>
        <bs:last-name>Gaiman</bs:last-name>
      </bs:author>
      <bs:genre>Horror</bs:genre>
      </bs:book>
... etc ...
    </bs:bookstore>

The JSON created

  {
    "bs:bookstore": {
      "@xmlns:bs": "http://www.liquid-technologies.com/sample/bookstore",
      "@xmlns:xs": "http://www.w3.org/2001/XMLSchema-instance",
      "bs:book": [
        {
          "@price": 10.99,
          "@publicationdate": "2008-10-20",
          "@ISBN": "978-0747596837",
          "bs:title": "The Graveyard Book",
          "bs:author": {
            "bs:first-name": "Neil",
            "bs:last-name": "Gaiman"
          },
          "bs:genre": "Horror"
        },
... etc ...
      ]
    }
  }

 

JSON to Object Roundtripping 

 

Looking at the JSON document, by default, attributes are prefixed with '@', namespace attributes are written out '@xmlns:bs' and names contain the namespace prefix 'bs:'. This is to enable full roundtripping of JSON back into the data objects using ToJson and FromJson methods.

If we want a vanilla JSON document, we can control the output using the SerializationContext.

 

C# Example

    SerializationContext.Default.JsonContext.SupportRoundtrip = JsonContext.RoundTrip.None;

C++ Example

    CSerializationContext::GetDefaultContext().GetJsonContext().SetSupportRoundtrip(JsonRoundTrip_None);

Now when the code is executed, the JSON output is as follows

  {
    "bookstore": {
      "book": [
        {
          "price": 10.99,
          "publicationdate": "2008-10-20",
          "ISBN": "978-0747596837",
          "title": "The Graveyard Book",
          "author": {
            "first-name": "Neil",
            "last-name": "Gaiman"
          },
          "genre": "Horror"
        },
... etc ...
      ]
    }
  }


Download a free trial of Liquid XML Data Binder today:
https://www.liquid-technologies.com/trial-download


Tuesday, May 08, 2018

Liquid Studio 2018 - Update 1

Liquid Studio 2018 - Update 1 (v16.1.0)

We are pleased to announce Update 1 of Liquid Studio 2018, adding new features and enhancements as requested by our end users.
  • NEW JSON support in XML Data Binder for C++, .Net and Java using ToJson() and FromJson() API methods.
  • Improved XML Data Binder Errors to include XPath or JSONPath to error location.
  • Fixed issue for BinaryData created with empty data in Liquid C++ Runtime.
  • Database Views can now be used as data sources.
  • Data Mapper Database Reader and Database Writer components can now use the app.Config to get the connection string.
  • Data Mapper Join now retains connectors when changing source.
  • Data Mapper Text Reader component can skip specified number of lines before reading data.
  • Added Data Mapper DateAdd component.
  • Fixed path resolution issues in Data Mapper.
  • Fixed copy and paste issue in Data Mapper.
  • Includes rollup of all previous fixes. 
This update is free for user with a current Upgrade Support Protection Plan (USPP).

Try the new features with our free trial from:
https://www.liquid-technologies.com/trial-download

Thursday, March 08, 2018

Liquid Studio 2018 v16.0.5.8184

Liquid Studio 2018 - v16.0.5.8184

  • Added new Join component to Data Mapper for fast lookup between two data sources.
  • Updated License documentation.
  • Fixed required attributes in XSD to JSON Schema conversion.
  • Fixed license issue running on Remote Desktop.
  • Fixed issue in XSD drag and drop.
  • Fixed issue in XML Data Binder for inherited ComplexType Choice.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Thursday, March 01, 2018

New JSON Editor Edition, SQLite, Schematron and XSLT 3.0 in Liquid Studio 2018

Press Release: Liquid Studio 2018 - now with advanced new features for JSON, XML, and Web Service Developers.

Liquid Studio 2018LEEDS, UK, March 2, 2017 - Liquid Technologies Limited (https://www.liquid-technologies.com) have announced the new Liquid Studio 2018 product suite, with tools for JSON, XML and Web Service Developers, plus seamless integration into Microsoft Visual Studio. Liquid Studio 2018 introduces a new JSON Editor Edition containing all of the JSON specific editors, tools and resources, along with all of the great features of the free Community edition.

“With the growing demand in the IT industry for JSON products, it made sense for us to provide a new low-cost new entry-level edition specifically for developers who require the Graphical JSON Schema editor and associated JSON tools,” said Simon Sprott, CTO of Liquid Technologies. “We have also included some great new features in 2018 requested by our growing user base, such as support for SQLite, Schematron and XSLT 3.0."

New feature highlights include:
  • JSON Schema Draft 6 support
  • JSON Document Outline View
  • JSON Schema Library
  • JSON Schema Documentation Tool for HTML and PDF
  • Schematron Editor and Validation
  • XSLT 3.0 support
  • Git Source Control Integration support
  • .Net Standard and .Net Core support in the XML Data Binder (https://www.liquid-technologies.com/xml-data-binder)
  • SQLite Data Mapper support
  • Parameterized SQL for Data Mapper DB Sources

Liquid Studio 2018 also provides a Large File Editor, XML Diff tool and Microsoft Visual Studio 2017 extensions for JSON Schema Editor, XML Schema Editor, WSDL Editor, XPath and Web Service Tools. A free trial download of the full product suite is also available (https://www.liquid-technologies.com/trial-download).

For more information about all Liquid Technologies products, services and features, please visit our website: https://www.liquid-technologies.com.

Monday, December 11, 2017

Liquid Studio 2018 BETA

Liquid Studio 2018 BETA is now available!

  1. Download from https://www.liquid-technologies.com/beta-download
  2. Use license key: BETA-2018-9P4B-XDLR-1FC7-DBAA
  3. Try out the new features and let us know what you think.