Wednesday, December 09, 2020

Liquid Studio 2020 v18.0.20

Liquid Studio 2020 v18.0.20

  • Fixed issue in Graphical XML Editor view with dynamic context menu showing incorrect options.
  • Fixed issues from crash reports.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Tuesday, December 08, 2020

Using xsi:type in XML Documents and XML Schemas

We recently received a question in our XML Community Forum regarding using an xs:choice compositor with many items in an XML Schema and the generated C# source code from Liquid XML Objects.

The issue described a scenario of a Repair Shop where you would want many possible choices, each choice representing a possible Repair.

For example, we could construct a simple XSD as follows:

<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid Studio 2020 (https://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="RepairType">
        <xs:choice>
            <xs:element name="RepairWheel" type="xs:string" />
            <xs:element name="RepairWindscreen" type="xs:string" />
... many more items ...
</xs:choice> </xs:complexType> <xs:element name="RepairShop"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="Repair" type="RepairType" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

Note: for simplicity we are using xs:string, but in reality this would represent a ComplexType containing all of the information pertaining to the type of 'Repair'.

The C# source code generated by Liquid XML Objects code generator from this XSD would include a class representing the 'RepairType' ComplexType and would contain a property for each possible repair:

public class RepairTypeCt
{
    public String RepairWheel { get; set; }
    public String RepairWindscreen { get; set; }
    ... many more items ...
}

Whilst this is perfectly correct C# source code, it is not ideal when checking which item of the choice has been set in code as we would need to check each item until we find the item which is not null.

Derivation by Extenion using xsi:type

One possible solution is to use xsi:type. In the following updated XSD we specify an abstract base type 'RepairType' and derive other types 'RepairWheel' and 'RepairWindscreen' from this using derivation by extension:

<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid Studio 2020 (https://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType abstract="true" name="RepairType" />
    <xs:complexType name="RepairWheel">
        <xs:complexContent>
            <xs:extension base="RepairType">
                <xs:sequence>
                    <xs:element name="WheelSize" type="xs:string" />
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RepairWindscreen">
        <xs:complexContent>
            <xs:extension base="RepairType">
                <xs:sequence>
                    <xs:element name="WindscreenSize" type="xs:string" />
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:element name="RepairShop">
        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element name="Repair" type="RepairType" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Now the generated C# source code contains 3 classes, a base class and 2 specialized derived classes:

public abstract class RepairTypeCt
{
}

public class RepairWheelCt : RepairTypeCt
{
    public String WheelSize { get; set; } = "";
}

public class RepairWindscreenCt : RepairTypeCt
{
    public String WindscreenSize { get; set; } = "";
}

We can now simply test the type of the repair and cast the value to the correct type in order to utilise the derived specialization as we would expect to in a polymorphic object model.

However, the XML document would need to change to refect the changes to the XSD in order for the XML processor to know which type of 'Repair' the element represents.

The original XML document would be as follows:

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Studio 2020 (https://www.liquid-technologies.com)-->
<RepairShop>
    <Repair>
        <RepairWheel>string</RepairWheel>
    </Repair>
    <Repair>
        <RepairWindscreen>string</RepairWindscreen>
    </Repair>
</RepairShop>

Using the new XSD, we would need to change the XML document to use xsi:type attribute to specify the type of 'Repair':

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Studio 2020 (https://www.liquid-technologies.com)-->
<RepairShop xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Repair xsi:type="RepairWheel">
        <WheelSize>string</WheelSize>
    </Repair>
    <Repair xsi:type="RepairWindscreen">
        <WindscreenSize>string</WindscreenSize>
    </Repair>
</RepairShop>

In summary, xsi:type provides a mechanism to support polymorphism within our generated C# code making the code cleaner and the XML easier to read and utilise.

Further information can be found in our XML Tutorial.

XML Tools

Please download a Free Trial of Liquid Studio graphical XML editor and Liquid XML Objects code generator from our web site:
https://www.liquid-technologies.com/trial-download


Tuesday, December 01, 2020

Liquid Studio 2020 v18.0.19

Liquid Studio 2020 v18.0.19

  • Fixed issue in C++ and Java XML Data Binder Runtimes for element value whitespace handling.
  • Fixed issue in Liquid XML Objects regular expression handler.
  • Fixed issues from crash reports.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download



Friday, November 13, 2020

Liquid Studio 2020 v18.0.18

Liquid Studio 2020 v18.0.18

  • Fixed issue using legacy OracleClient .Net Driver for older Oracle Databases.
  • Fixed issues using GroupBy component in Liquid Data Mapper.
  • Optimised Liquid Data Mapper to prioritize Errors over Warnings.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Tuesday, November 10, 2020

Liquid Studio 2020 v18.0.17

Liquid Studio 2020 v18.0.17

  • Fixed issues in XML Data Binder for C# and Visual Basic .Net generated code trying to link to .Net Standard 2.1 in Liquid Runtime.
  • Fixed issue with Liquid Studio F1 failing to find online Help.
  • Fixed issue in Data Mapper JSON Writer for additionalItems.
  • Fixed issue handling apostrophes in spell checker.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

 

Monday, October 26, 2020

Liquid Studio 2020 v18.0.16

Liquid Studio 2020 v18.0.16

  • Fixed issues using OLE-DB Database Connections (e.g. for Microsoft Access Databases).
  • Fixed issue from crash reports.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

 

Thursday, October 08, 2020

Liquid Studio 2020 v18.0.15

Liquid Studio 2020 v18.0.15

  • Fixed issue in Data Mapper for recursive types.
  • Fixed issue in XML Objects when using whitespace in Enum values.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

 

Wednesday, September 30, 2020

Liquid Studio 2020 v18.0.14

Liquid Studio 2020 v18.0.14

  • Data Mapper performance enhancements for compiling transforms.
  • Fixed issue where Cast properties were lost after component re-sync.
  • Fixed issue running Data Mapper from command line.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Tuesday, September 22, 2020

Liquid Studio 2020 v18.0.13

Liquid Studio 2020 v18.0.13

  • Added automatic date type conversion during construction of an LxDateTime in Liquid XML Objects Runtime.
  • Data Mapper performance enhancements for loading large transforms.
  • Fixed issue writing JSON additionalProperties in Data Mapper.
  • Fixed issue where User Defined properties were lost after component re-sync.
  • Fixed find not working in main toolbar of Liquid Studio.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Tuesday, September 01, 2020

Liquid Studio 2020 v18.0.12

Liquid Studio 2020 v18.0.12

  • Added new Combine Nodes component to Data Mapper.
  • Fixed issue with resync of duplicate nodes in Data Mapper.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Wednesday, August 05, 2020

Liquid Studio 2020 v18.0.11

Liquid Studio 2020 v18.0.11

  • Fixed issues with using Import/Include/Override/Redefine functionality and Chameleon XML Schema.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Thursday, July 23, 2020

Liquid Studio 2020 v18.0.10

Liquid Studio 2020 v18.0.10
  • Fixed issue with Data Mapper Database Source component properties dialog not displaying SQL statement for Views.
  • Fixed issue with using JSON Schema generated documentation in Chrome.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Tuesday, July 14, 2020

Liquid Studio 2020 v18.0.9

Liquid Studio 2020 v18.0.9
  • Fixed issue with Data Mapper component palette displaying scrollbars in small icon mode.
  • Fixed issue with entering escaped characters into Const component in the Data Mapper.
  • Fixed issues with creating a sample JSON document from a JSON Schema.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Wednesday, May 27, 2020

Liquid Studio 2020 v18.0.8

Liquid Studio 2020 v18.0.8
  • Added support for XSD recursively defined groups in Liquid XML Objects Code Generator.
  • Fixed issue with schema resolution in Liquid XML Objects.
  • Fixed issue with default values in DTD Parser.
  • Updated Documentation.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download


Friday, May 15, 2020

Liquid Studio 2020 v18.0.7

Liquid Studio 2020 v18.0.7
  • Fixed issue with opening files from redirected URLs (308 Permanent Redirect).
  • Updated Documentation.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Friday, May 01, 2020

Liquid Studio 2020 v18.0.6

Liquid Studio 2020 v18.0.6
  • Improved user experience on High DPI monitors.
  • Restricted Database Viewer to exclude system tables.
  • Added ability to process MySQL JSON native type in Data Mapping.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download
 

Tuesday, April 21, 2020

Liquid Studio 2020 v18.0.5

Liquid Studio 2020 v18.0.5
  • Updated Data Mapper command line to allow relative paths to .dm files.
  • Fixed issues running Wizards on High DPI monitors.
  • Fixed issues in Liquid XML Objects Runtime for XML to JSON.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Tuesday, March 17, 2020

Liquid Studio 2020 v18.0.4

Liquid Studio 2020 v18.0.4
  • Changed the Liquid XML Objects Runtime to not close streams - This is a breaking change as client is now responsible for closing streams.
  • Added option to omit xsi:type from output for Liquid XML Objects serialization.
  • Fixed issues in Liquid XML Objects Runtime for XML to JSON.
  • Fixed issues with using the MySQLConnector Database Provider.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Tuesday, March 10, 2020

Liquid Studio 2020 v18.0.3

Liquid Studio 2020 v18.0.3
  • Updated Oracle Database Provider to support ODP.Net Managed Driver, and added to install.
  • Updated MySQL Database Provider to support MySQLConnector, and added to install.
  • Fixed issue with app deleting Database Connections if connection does not work.
  • Fixed Schematron validation for 'report' elements.
  • Added Schematron support for 'role' attribute (fatal, error, warning, warn, information, info) to specify error level on 'assert' and 'report' elements.
  • Fixed issue with XSD 1.1 processing in Liquid XML Objects.
  • Fixed issue with Alternative intellisense options in XSD editor.
  • Updated Documentation.
  • General Fixes.
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Monday, February 24, 2020

NEW Tutorial 'Using JSON with Liquid XML Objects'

NEW Tutorial 'Using JSON with Liquid XML Objects'...


This new tutorial explains how to read and write JSON data with Liquid XML Objects, including round-trip conversion of JSON to XML and XML to JSON.

Topics covered:
liquid-technologies.com/xml-data-binde


#liquidstudio2020

Saturday, February 22, 2020

Liquid Studio 2020 v18.0.2

Liquid Studio 2020 v18.0.2
  • Fixed Issues in Liquid XML Objects with JSON Serializer.
  • Fixed issue in Liquid XML Objects when using XSD 1.1 xs:alternative.
  • Fixed issue with Project Tree not scrolling while dragging items.
  • Fixed issue using spaces in paths with Microsoft XSLT Debugger.
  • Updated Documentation.
  • General Fixes
Download a Free Trial:
https://www.liquid-technologies.com/trial-download

Tuesday, February 11, 2020

New Release Liquid Studio 2020 v18.0.1

NEW RELEASE Liquid Studio 2020 - 18.0.1

Liquid Studio 2020

Data Mapper

  • NEW PostgreSQL database integration
  • NEW VistaDB 6 database integration
  • Added SQLite libraries to installer
  • Added PostgreSQL libraries to installer
  • Added option to append to TextFile CSV Data Target
  • Fixed stack overflow issue when using large lookup lists
  • Fixed issue using SQLite from generated libraries
  • Fixed issue using VistaDB 5 from generated libraries
  • Fixed issues with data Encoding in XML Writer component

XML Data Binder

  • Added .Net Core 3.1 option for C# and Visual Basic .Net generated projects
  • Added ASYNC_FROMXMLFILE option for LINUX builds
  • Fixed missing Visual Basic .Net entries in command line processing
  • Upgraded C++ runtime to use Expat 2.2.9 for security fixes

Liquid XML Objects

  • NEW LjSerializer to Read and Write the XML Object Model as JSON documents
  • NEW Web Extensions to allows Liquid XML Objects to be used as arguments in an MVC or MVCCore Controller
  • NEW XSD Attributes to allow numeric formatting rules
  • NEW Caddy file to allow numeric formatting rule
  • Added thread safe code to LxSerializer
  • Fixed issue with pluralizing names

JSON Schema Editor

  • Fixed issue with dependencies not being written
  • Fixed issue with nested root schema references
  • Fixed issue with self referencing schema

JSON Editor

  • Fixed issue with using Ctrl+Tab
  • Fixed issue with overflow when reading decimal values
  • Fixed issue parsing decimals from a string with an exponent
  • Fixed issue deserializing empty array
  • Fixed issue deserializing empty string

WSDL Editor

  • Fixed issue loading WSDL containing embedded XSD where an import element's schameLocation has a relative path
  • Fixed issue with using soap:fault name attribute

WADL Editor

  • Fixed issue loading WADL containing embedded XSD where an import element's schameLocation has a relative path

Visual Studio Integration

  • Improvided usage in Visual Studio 2017 and Visual Studio 2019 on High DPI monitors


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