|
BDE 4.39.x Production Release
|
Basic Application Library XML (balxml)
Provide utility components for using XML and XSD.
Basic Application Library XML (balxml)
The balxml package provides utilities for working with XML and XSD. Clients can use the components provided by balxml for parsing and printing fundamental types, XML schema, and XML data documents. Typical usage is illustrated in the balxml_encoder and balxml_decoder components documentation.
There are 2 sets of the encoding/decoding member functions:
encode & decode, andencodeAny & decodeAny (referred as "any-functions" below).The first set uses templates and compile-time metaprogramming to generate the encoding/decoding C++ code. The second set uses the runtime dispatch approach - base classes and virtual functions - to provide the same functionality. The result does not depend on the functions you use - their functionality is absolutely identical. The difference is not in what they do, but in how they do it.
As usual, the compile-time approach can be faster, but generates a lot of code. And since this code is in the headers, this causes big load on the compiler and linker - the generated code is in each translation unit and in the object file generated from it. As a result, slow compilation, huge memory and CPU consumption during the compilation and linking, and a larger resulting executable file size.
All the above mentioned shortcomings (except the final runtime performance) can be mitigated by using the "any-functions", at the cost of a small runtime slowdown. All the encoding/decoding code is pre-compiled and located in one place - the BDE library (archive) files. But how big is the execution slowdown? Our benchmarks show that the slowdown is less than 10%.
The script 'code_from_xsd.pl' will automatically generate several components from the file 'balxml.xsd'. It will refuse to run in the 'balxml' source directory. Create a separate, temporary directory and copy 'balxml.xsd' and 'code_from_xsd.sh' into it, 'cd' into that directory, and run 'code_from_xsd.sh' there will no command-line arguments.
Note that the balxml_encodingstyle component will need hand-editing due to redundant, synonymous enum values.
The 'balxml' package currently has 24 components having 6 levels of physical dependency. The list below shows the hierarchical ordering of the components. The order of components within each level is not architecturally significant, just alphabetical.
balxml_base64parser : !DEPRECATED! Provide push parser for Base64 types.
balxml_configschema : Provide the service configuration schema
balxml_decoder : Provide a generic translation from XML into C++ objects.
balxml_decoderoptions : Provide value-semantic attribute classes
balxml_elementattribute : Provide the properties of an attribute in an XML element tag.
balxml_encoder : Provide an XML encoder utility.
balxml_encoderoptions : Provide value-semantic attribute classes
balxml_encodingstyle : Provide value-semantic attribute classes
balxml_errorinfo : Provide common error information for XML components.
balxml_formatter : Provide a simple interface for writing formatted XML.
balxml_formatter_compactimpl : !PRIVATE! Provide a minimal-whitespace implementation for balxml_formatter .
balxml_formatter_prettyimpl : !PRIVATE! Provide pretty-printing implementation for balxml_formatter .
balxml_formatterwhitespacetype : Enumerate the set of whitespace options for balxml_formatter .
balxml_hexparser : Provide push parser for hex types.
balxml_listparser : Provide push parser for lists.
balxml_minireader : Provide light-weight implementation of balxml::Reader protocol.
balxml_namespaceregistry : Provide a unique integer ID for each XML namespace.
balxml_prefixstack : Provide a unique integer ID for each XML namespace.
balxml_reader : Provide common reader protocol for parsing XML documents.
balxml_typesparserutil : Provide a utility for parsing types using XML formatting.
balxml_typesprintutil : Provide a utility for printing types using XML formatting.
balxml_utf8readerwrapper : Provide wrapper for Reader to check input UTF-8 validity.
balxml_util : Provide a suite of common XML utilities.
balxml_validatingreader : Provide a common reader protocol for parsing and validating XML.