XSD/e: XML Processing for Embedded Systems

CodeSynthesis XSD/e is an open-source XML parser/serializer generator for mobile and embedded systems. It provides event-driven, stream-oriented XML parsing, XML serialization, XML Schema validation, and C++ data binding while maintaining a small footprint and portability. XSD/e implements three XML Schema to C++ mappings: Embedded C++/Parser for event-driven XML parsing, Embedded C++/Serializer for event-driven XML serialization, and Embedded C++/Hybrid which provides a light-weight, in-memory object model on top of the other two mappings.

The C++/Hybrid mapping generates C++ classes for types defined in XML Schema as well as parsing and serialization code. The C++ classes represent the data stored in XML as a statically-typed, tree-like object model and support fully in-memory as well as partially in-memory/partially event-driven XML processing. For an introduction to the C++/Hybrid mapping, refer to the Hello World Example from the Embedded C++/Hybrid Mapping Getting Started Guide.

The C++/Parser mapping generates validating C++ parser skeletons for types defined in XML Schema. You can then implement these parser skeletons to build your own in-memory representation or perform immediate processing as parts of your XML documents become available. For an introduction to the C++/Parser mapping, refer to the Hello World Example from the Embedded C++/Parser Mapping Getting Started Guide.

Similarly, the Embedded C++/Serializer mapping generates validating C++ serializer skeletons for types defined in XML Schema which can be used to serialize your data to XML. For an introduction to the C++/Serializer mapping, refer to the Hello World Example from the Embedded C++/Serializer Mapping Getting Started Guide.

Based on the static analysis of the schemas, XSD/e generates compact, highly-optimized hierarchical state machines that combine data conversion, validation, and even dispatching in a single step. As a result, the XSD/e-generated code is 2-10 times faster than general-purpose XML Schema validators while maintaining the lowest static and dynamic memory footprints. For example, a validating parser executable can be as small as 120KB in size. The following figure highlights the advantages of XSD/e in comparison to the traditional architectures:

XSD/e is also highly-portable and can be used without STL, RTTI, iostream, C++ exceptions, and C++ templates. Compared to APIs such as DOM, SAX, XMLReader, and XMLWriter, XSD/e has the following advantages:

These technical advantages translate to the following business benefits: