[xsd-users] DOM parser for embedded environment

Boris Kolpackov boris at codesynthesis.com
Wed Jun 4 07:41:31 EDT 2008


Hi Shiva,

Balasubramanyam, Shivakumar <sbalasub at qualcomm.com> writes:

> Do you have any timeline for this feature?

We are planning to release the first version of XSD/e with
the C++/Tree-like mapping (working name C++/Hybrid) by the
end of October. We may have something for you to try (e.g.,
a beta version) around mid-September.

> Compared to C++/Tree, some features that need to be eliminated
> are 

> boost dependency

Actually, C++/Tree mapping does not depend on boost. There are
some integration points (e.g., binary serialization) but they
are optional.


> exceptions

Yes, we plan to make the use of C++ exceptions optional just like
in our other mappings provided by XSD/e.


> optimal template usage

This is actually a feature that we are trying to decide whether
to rely on or not so your feedback is very much appreciated.
Right now it seems that it would be just too much inconvenience
not to use it in specific cases (notably to implement sequences
and smart pointers).

Do you use C++ templates in your embedded projects? If so, do
you rely on implicit or explicit instantiation? It should be
fairly straightforward for the XSD/e compiler to auto-generate
explicit template instantiation requests.


> I will be interested in understanding the features you are planning
> to support. 

The C++/Hybrid will be based on Embedded C++/Parser for parsing and 
Embedded C++/Serializer for serialization. Because these two mappings
support validation in the generated code, C++/Hybrid will also have
this feature.

In essence C++/Hybrid will consist of there parts: C++ object model
classes, parser implementations based on C++/Parser and serializer
implementations based on C++/Serializer. You will probably be happy
to know that the C++ object model will be completely detached from
parsing and serialization code ;-)

We are planning to make the C++ object model lighter-weight compared
to C++/Tree based on some of the techniques of the CORBA IDL to C++
mapping (used quite extensively in embedded systems). For example,
we will have a notion of variable and fixed length types with the
fixed-length ones being embedded and passed around by value instead
of being allocated on the heap, for example:

class point
{
  float x;
  float y;
};

class triangle
{
  point a, b, c;
};

We are also planning to use a different mapping for certain choice
and sequence constructs. For example:

<complexType name="foo">
  <sequence maxOccurs="unbounded">
    <element name="bar" type="int"/>
    <element name="baz" type="int"/>
  </sequence>
</complexType>


Will be mapped to something along these lines:

class foo
{
  class sequence_element
  {
    int bar ();
    int baz ();
  };

  typedef xsde::sequence<sequence_element> sequence_type;

  sequence_type& sequence ();  
};

Later we will most likely port over other C++/Tree features that
make sense in the embedded environment, such as binary serialization,
type customization, etc. Also let me know if there is any particular
feature that you are interested in and we will keep it in mind. 

Boris




More information about the xsd-users mailing list