XSD: XML Data Binding for C++

CodeSynthesis XSD is an open-source, cross-platform W3C XML Schema to
C++ data binding compiler. Provided with an XML instance specification
(XML Schema), it generates C++ classes that represent the given
vocabulary as well as XML parsing and serialization code.
You can then access the data stored in XML using types and functions
that semantically correspond to your application domain rather than
dealing with the intricacies of reading and writing XML:

The process of extracting the data from a direct representation of
XML (such as DOM or SAX) and presenting it as a hierarchy of objects
or events that correspond to a document vocabulary is called
XML Data Binding. An XML Data Binding compiler accomplishes this
by establishing a mapping or binding between XML Schema and a target
programming language. For more information on why use XML Data
Binding and CodeSynthesis XSD, see Reasons
to Use.

XSD supports two XML Schema to C++ mappings:
in-memory C++/Tree
and stream-oriented C++/Parser.
The C++/Tree mapping represents the information stored in XML
documents as a tree-like, in-memory object model.
C++/Parser is a new, SAX-like mapping which represents the data
stored in XML as a hierarchy of vocabulary-specific parsing events.
The following table summarizes key advantages of the two C++ bindings:

C++/Tree

C++/Parser

Ready to use type system for in-memory representation

Fit into existing type system by constructing your
own in-memory representation

Complete XML document view and referential integrity

Perform immediate processing as parts of the document become available (streaming)

Optional association with underlying DOM nodes

Handle XML documents that are too large to fit into memory

Additional features: serialization back to DOM or XML,
support for ID/IDREF cross-referencing, etc.

Small footprint, including code size and runtime memory consumption

Compared to APIs such as DOM and SAX, XML data binding allows
you to access the data in XML documents using your domain
vocabulary instead of generic elements, attributes, and text.
Static typing helps catch errors at compile-time rather
than at run-time. Automatic code generation saves time and minimizes
the effort needed to adapt your applications to changes in the
document structure.

The following two examples show the amount and complexity of
code needed to access the information in the above XML using
generic C++ APIs compared to C++ bindings:

Features

Elegant C++ Mappings and Portable Generated Code - We took
great care in designing our XML Schema to C++ mappings to ensure
that they are simple, intuitive and enjoyable to work with. We
also made sure that our generated code is portable across a wide
range of operating systems and C++ compilers. See
Supported Platforms and Compilers
for more information.

Comprehensive XML Schema Feature Coverage - XSD includes
complete support of the W3C XML Schema specification for validation
and supports all important and widely used features for data
binding. Many complex,
real-world schemas have been successfully compiled by XSD.

Easy Integration - The following features make it easy to
start using XSD in your application:

Header-only runtime library

Customization of the generated C++ code

Industry-standard underlying XML parsers: Xerces-C++ and
Expat

Generated classes are compatible with a wide range of
algorithms from the C++ standard library and Boost

Open-Source - The compiler and the runtime library are
available with full source code under the terms of the GPL.
We also made a special exception to the terms and conditions
of the GPL which allows you to use the runtime library and the
generated code in a wide range of open-source software. See
XSD Licensing Information for
details. With the open-source model come the following benefits:

No vendor lock-in

You have the ability to customize the compiler in-house

Additional testing and feedback from the open-source
community. For example, using bug reports we built a large
repository of real-world schemas which we use for regression
testing

Build as much of your application as necessary before
making a commitment

Download and try our complete product
for as long as necessary (no registration required).

Cross-Platform - Available for 6 major operating
systems on 7 different CPU architectures and tested with 16
C++ compiler variants. See Supported
Platforms and Compilers for details.

Community and Priority Support - We provide free,
best-effort community technical support via the
xsd-users mailing list.
We also offer priority support on a commercial basis. Visit our
Support page for more information.