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.05
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.04
-
Output format (indented versus continuous) is now set via
a package specification variable instead of an instantation parameter.
(The parameter is still present, but deprecated.)
-
By default, if an attribute has an empty value, the
attribute is not output. That can be changed by setting the value of
the Default_Output_Null_Attributes variable.
Reports of errors or suggested enhancements would be appreciated.
©2006 McKae Technologies