C++/Tree: In-Memory XML Data Binding
The C++/Tree mapping generates C++ classes that represent data types defined in XML Schema, a set of parsing functions that convert XML documents to a tree-like in-memory object model, and a set of serialization functions that convert the object model back to XML. For an introduction to the C++/Tree mapping, refer to the Hello World Example from the C++/Tree Mapping Getting Started Guide.
Features
- Robust, clean and compact C++ standard library-based
language mapping; you don't need to learn much if you know how
to use
std::string
andstd::vector
. - Support for C++11 and C++98/03.
- Configurable base character type:
char
orwchar_t
. - Configurable application character encoding (UTF-8, ISO-8859-1, UTF-16, UTF-32, local code page).
- Natural mapping for all W3C XML Schema built-in types:
xsd:boolean
tobool
,xsd:string
tostd::string
, etc. - Serialization of the object model back to DOM and XML with support for streaming.
- Generation of documentation comments in the Doxygen format that include documentation extracted from schemas.
- Automatic generation of
std::ostream
insertion operators (operator<<
, useful for debugging and tracing). - Automatic generation of comparison operators.
- Customization of the generated code including XML Schema built-in types.
- Mapping of
xsd:enumeration
to C++enum
. - Customizable XML Schema namespace to C++ namespace mapping.
- Customizable identifier naming convention in the generated code.
- Support for statically-typed ID/IDREF cross-referencing.
- Support for XML Schema polymorphism (
xsi:type
and substitution groups). - Support for accessing/modifying wildcard content
(
xsd:any/xsd:anyAttribute
) as DOM fragments which can also be used to create/serialize object models. - Support for accessing/modifying
xsd:anyType
andxsd:anySimpleType
as DOM and text fragments, respectively. - Support for preserving strict content order, including mixed content.
- Support for uniform parsing and serialization of XML documents with varying root elements.
- Support for default and fixed values.
- Support for stream-oriented, partially in-memory XML processing.
- Option to maintain association with underlying DOM nodes.
- Support for locating object model nodes with XPath queries.
- Extensible, high-performance serialization to compact binary formats for storage or over-the-wire transfer (RPC XDR, ACE CDR streams, and Boost serialization are supported out of the box, custom formats and APIs can be easily added).
- Automatic morphing of anonymous types into named ones with support for name customization.
- Support for schema importing, inclusion and chameleon-style inclusion.
- Support for the file-per-schema and file-per-type compilation models.
- Support for
make
dependency generation.
The following diagram shows the main integration areas of the C++/Tree mapping and related technologies:
Documentation
C++/Tree Mapping Getting Started Guide | An introduction to the C++/Tree mapping with examples. Also available in PDF and PostScript. |
---|---|
C++/Tree Mapping User Manual | A comprehensive description of the C++/Tree mapping, including the parsing and serialization mechanisms. Also available in PDF and PostScript. |
XSD Compiler Command Line Manual | Compiler's command line interface documentation (available compiler options, etc). |
C++/Tree Mapping FAQ | Answers to frequently asked questions about the C++/Tree mapping. |
Schema Compilation Checklist | A checklist-like run through the most commonly used XSD command line options. |
C++/Tree Mapping Customization Guide | A guide to customizing generated and XML Schema built-in types. |
C++/Tree Mapping Wiki Page | A resource page for the C++/Tree mapping on Code Synthesis Wiki. |
XSD Wiki Page | A resource page for XSD on Code Synthesis Wiki. |
Support
We provide free, best-effort technical support for XSD via the xsd-users mailing list. Simply send an email to this mailing list with the description of a bug or a problem that you encountered. Please follow the Posting Guidelines to receive a prompt reply.
We also offer priority support on a commercial basis. Visit our support page for more information.
Resources
XSD project page | Source code, build instructions and other information for XSD compiler developers. |
---|---|
XSD contributions | Various third-party contributions to XSD. |
XML Data Binding in C++ | An article in the C++ Source journal introducing XML Data Binding in C++. |
XML Schema Part 0: Primer | An easily approachable description of the XML Schema facilities. It is oriented towards quickly understanding how to create schemas using the W3C XML Schema language. |