XML Data Binding Overview

Previous Menu Next

Overview of How XML Data Binding Works

XBinder is a source code generator; it takes an XML schema document as its input and produces computer source code in one of four languages (C, C++, Java, or C#) from it. XBinder is also referred to as a compiler, but unlike most compilers, which take source code and translate it to object or executable code, XBinder takes a schema document and translates it to source code. The generated source code contains data structures and objects that can hold the data contained in an XML instance that's based on the schema. The code also contains functions and methods that can be used to perform various operations on the data.

Once the code generation is done, the source code that is generated can be used at run-time to decode and encode XML instances. Decoding is the process of taking the data in an XML instance and populating the corresponding data structures and objects with those values. Encoding is the opposite; it is the process of taking data values that are in the generated data structures and objects and creating an XML instance from them. The code generated by XBinder includes functions and methods to do this encoding and decoding.

In addition to the generated code, there is a run-time library included with XBinder for each of the four languages. The run-time libraries include functions and methods that the generated code, and in some cases customer code, can make use of during decoding, encoding, and other operations. For C and C++ the run-time library is either a native DLL or a shared library, depending on the platform. For Java the run-time library is a jar file. And for C#, which is currently an offering just for Windows platforms, the run-time library is a .NET assembly (also expressed as a DLL file).

The diagram below, which is taken from the XBinder product information page on the Objective Systems web site, illustrates these points:

XML data binding process flow diagram

 

In a later section of the tutorial we'll work through taking a schema document and producing code from it.

Previous Menu Next