Languages

A multi-language approach

XMLBooster is a multi-language solution, that can be used to centralize the definition of XML messages exchanged by sub-systems written in different languages.

While it aims at providing similar if not equivalent levels of service in all the languages it supports, XMLBooster also adapts, and tries to take advantage of the various features offered by these languages (inheritance, commonly used classes, etc.)

On the other hand, some features (mostly related to inheritance and more generally, to polymorphic data structures) are not available in all the languages XMLBooster supports. Please check for the code generator you consider using to make sure it supports the features you need.

XMLBooster’s C Code generator

The C Code generator included in XMLBooster is extremely efficient, and is aimed at cases where performance is of paramount importance (See our benchmarks):

  • Generates a parser (to convert an XML input to a valid C data structure) as well as an unparser (to convert the C data structure back to an XML stream).
  • Generates standard ANSI C code, that can be compiled on virtually any platform, including NT, Linux, Unix, etc.
  • Supports its own allocation mechanism within fixed size buffers for faster memory management and no memory leak possible.
  • Mainly macro-based, to avoid the overhead of function calls for a number of primitives called from within tight loops.
  • Can generate pointer-free (Flat mode) as well as truly hierarchical data structures, with inheritance and polymorphism.
  • Inheritance is simulated by concatenating data structures.
  • Error recovery is implemented by a number of convenient macros, so that failure to parse does not abort the program.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.

XMLBooster’s C++ Code generator

The C++ code generator included in XMLBooster aims at providing a more convenient interface than the bare bone C code generator, at a minor cost in terms of performance:

  • Generates a parser (to convert an XML input to a valid C++ data structure) as well as an unparser (to convert the C++ data structure back to an XML stream).
  • Generates standard C++ code, that can be compiled on virtually any platform, including NT, Linux, Unix, etc.
  • Generates a convenient and strongly typed interface to access the information parsed by XMLBooster, using templates whenever possible.
  • Uses user-defined classes for collections and strings. By default, XMLBooster uses classes provided by the STL (Standard Template Library).
  • Generates destructors for all nodes of a parsed XML message, thereby avoiding memory leaks.
  • Performs error recovery without using C++’s exception mechanism.
  • Inheritance in terms of elements is mapped onto equivalent inheritance relationships for the corresponding generated classes.
  • All instances are created through calls to a user-redefinable factory, so that subclassing can be used to add behavior to the objects that are created as part of the parse tree.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.

XMLBooster’s C# Code generator

The C# code generator included in XMLBooster to handle efficient parsing/unparsing. Its features are :

  • Generates a validating parser (to convert an XML input to a valid C# data structure) as well as an unparser (to convert the C# data structure back to an XML stream).
  • Generates standard C# code, that can be compiled on the .NET platform.
  • Generates a convenient and strongly typed interface to access the information parsed by XMLBooster.
  • XML enumerated values are converted to C# enumerated values, thereby reducing the impedance mismatch considerably.
  • The generated code is documented in ndoc format, so that the API can be easily navigated using existing tools.
  • Uses user-defined classes for collections and strings. By default, XMLBooster uses classes provided by the standard C# library.
  • Inheritance in terms of elements is mapped onto equivalent inheritance relationships for the corresponding generated classes.
  • All instances are created through calls to a user-redefinable factory, so that subclassing can be used to add behaviour to the objects that are created as part of the parse tree.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.

XMLBooster’s Java Code generator

  • Generates a parser (to convert an XML input to a valid Java data structure) as well as an unparser (to convert the Java data structure back to an XML stream).
  • Generates standard Java code, that can be compiled and run on virtually any platform, including NT, Linux, Unix, etc.
  • Generates a convenient and strongly typed interface to access the information parsed by XMLBooster. For instance, since the Java collections do not support strongly typed genericity, an ad hoc interface is generated to ensure that all the types used by the system are consistent.
  • Uses user-defined classes for collections.
  • Performs error recovery when dealing with a recoverable error, and raises a Java exception in case of a non-recoverable error.
  • Inheritance in terms of elements is mapped onto equivalent inheritance relationships for the corresponding generated classes.
  • All instances are created through calls to a user-redefinable factory, so that subclassing can be used to add behavior to the objects that are created as part of the parse tree.
  • One can attach a class to a leaf-element (that cannot be further decomposed), rather than relying on the default behavior of using plain Java Strings for that purpose. This facility, typically in conjunction with regular expressions (see below) can be used to define dates, amounts, timestamps, etc.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.

XMLBooster’s COBOL Code generator

  • Generates a parser (to convert an XML input to a valid COBOL data structure) as well as an unparser (to convert the COBOL data structure back to an XML stream).
  • Generates standard COBOL code, that can be compiled and run on virtually any platform, including NT, Unix, VMS, MVS, etc.
  • Due to limitations in the COBOL type system, XMLBooster’s COBOL code generator does not support inheritance and polymorphism.
  • Collections are translated to arrays, together with an integer indicating the number of entries that have been filled.
  • System-wide type definitions to map the XMLBooster types (integer, boolean, enumeration, real), plus the ability to specify a separate format on a field by field basis.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.
  • The way XMLBooster builds COBOL identifiers (for data elements as well as for labels) can be tuned, to avoid name clashes, even if a COBOL program includes two or more XMLBooster-generated parsers.
  • Enumerations are translated to level 88 names, in order to improve the readability of the application programs that must interact with XMLBooster-generated code.

XMLBooster’s Delphi Code generator

  • Generates a parser (to convert an XML input to a valid Delphi data structure) as well as an unparser (to convert the Delphi data structure back to an XML stream).
  • Generates a convenient and strongly typed interface to access the information parsed by XMLBooster. For instance, since the Delphi collections do not support strongly typed genericity, an ad hoc interface is generated to ensure that all the types used by the system are consistent.
  • Performs error recovery when dealing with a recoverable error, and raises a Delphi exception in case of a non-recoverable error.
  • Inheritance in terms of elements is mapped onto equivalent inheritance relationships for the corresponding generated classes.
  • All instances are created through calls to a user-redefinable factory, so that subclassing can be used to add behavior to the objects that are created as part of the parse tree.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.

XMLBooster’s Ada Code generator

  • Generates a parser (to convert an XML input to a valid Ada data structure) as well as an unparser (to convert the Ada data structure back to an XML stream).
  • Generates standard Ada95 code, that can be compiled on virtually any platform, including NT, Linux, Unix, etc.
  • Inheritance in terms of elements is mapped onto equivalent inheritance relationships for the corresponding generated objects.
  • Performs error recovery when dealing with a recoverable error, and raises an Ada exception in case of a non-recoverable error.
  • Fully supports regular expressions: a data element can be attached to a regular expression, which will be used to validate the data fetched from the incoming XML message at parse time.
  • Aggressively tested memory management strategy, in order to guarantee stability of memory usage even when millions of XML messages have been processed.

XMLBooster’s SWIG Code generator

Together with SWIG (http://www.swig.org), one can use highly-optimized XMLBooster generated parsers from within dynamic languages such as Python (Other similar scripting languages are to follow). SWIG is a tool that exposes C libraries to a number of language and environments, so that a highly optimized primitives can be combined seamlessly from within dynamic and interactive languages, thereby aiming at providing the best of both worlds: the performance of C and the flexibility and interactivity of interpreted environments.

The SWIG code generator included in XMLBooster is based on the following assumptions:

  • As one can expect, XMLBooster’s SWIG code generator is based on its C code generator.
  • SWIG is a compiler that takes C declarations as input and creates the wrappers needed to access those declarations from other languages. The “.h” file produced by XMLBooster is therefore annotated with special SWIG directives.
  • Even if most of the machinery is strictly identical across target languages, XMLBooster has separate code generator for each of the different SWIG target it supports so that subtle differences can be taken into account.
  • XMLBooster (or rather, SWIG) generates objects in the target scripting language to represent the data structures of the underlying XML document. These objects are just facades. SWIG creates accessor functions for each field of each element, and these functions will ultimately read and write field in the underlying C structure.
At the time of this writing, only Python is supported, other targets are to be added in the near future.

 

Sign in
classic
Forgot password?
×
Sign up

(*) Required fields

I agree with Raincode Terms & Privacy Policy

×
CONTACT US