XML EZ Out is a small set of packages intended to aid the creation of XML-formatted output from within Ada programs. It basically wraps the tags and data provided to it with XML syntax and writes them to a user-supplied medium.

This medium can be any sort of writable entity, such as a file, a memory buffer, or even a communications link, such as a socket. The only functionality required of the medium is that it supply a meaningful "Put" (for writing a string) and "New_Line" procedure.

Simply "with" the desired package, instantiate it if necessary, and then "use" it. The XML EZ_Out packages are explicitly designed to have "use" clauses applied. Insisting on using selected notation will greatly impair readability and makes EZ Out rather awkward to use. (Get a waiver from your programming standard if you have to!)

Here's a brief example. Generating this XML element:

<player lastName="Cuddyer" firstName="Michael" team="Twins"/>

would be done as:

Output_Tag(F, "player", ("lastName" = "Cuddyer", "firstName" = "Michael", "team" = "Twins"));

     

Current Status of XML EZ Out

Version: 1.06

This version of XML EZ Out supports writing to an application-specified I/O medium (e.g. file, memory buffer) via instantiation, and also provides pre-instantiated text file and memory buffer packages.

A test file, tmeztf.adb demonstrates instantiations and use of XML EZ Out's various components.

Changes since 1.05

  • Fixed bug where calling Output_Content with a negative integer or float argument would drop the leading minus sign.
  • Added ability to completely deallocate memory used by the String_Stream package.

Reports of errors or suggested enhancements would be appreciated.

 

 
 
 

©2006 McKae Technologies