Friday, July 20, 2018

Data Mapper - Connecting to and Configuring a Database Data Source

This video shows you how to connect to and configure database data sources using Liquid Data Mapper.






A free trial of the Liquid Data Mapper is available from:
https://www.liquid-technologies.com/trial-download

Friday, July 13, 2018

Liquid Studio 2018 v16.1.7.8497

Liquid Studio 2018 - 16.1.7.8497

  • Fixed issue with JSON Schema Draft 6 IDs.
  • Fixed issue with XQuery sometimes not displaying menu and toolbar for debugging.
  • General Fixes.

Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Liquid Studio 2018 v16.1.6.8487

Liquid Studio 2018 - 16.1.6.8487

  • Added XSLT 3.0 file type option
  • Fixed issue with embedded XSD not getting saved into WSDL
  • Fixed slow update when changing schemaLocation in XSD
  • Fixed issue running XSLT with initial template
  • General Fixes
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Wednesday, May 23, 2018

Data Mapper - Using Joins with Multiple Data Sources

This video shows you how to create a transform to join data from multiple data sources using Liquid Data Mapper.






A free trial of the Liquid Data Mapper is available from:
https://www.liquid-technologies.com/trial-download

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