[xsd-users] Differencies between xsd and xsde

Boris Kolpackov boris at codesynthesis.com
Tue Jun 14 06:18:48 EDT 2011


Hi Joël,

Klaim - Joël Lamotte <mjklaim at gmail.com> writes:

>  1. it targets embedded softwares

Yes, though it can be used for general-purpose software as well. Quite
a few people use it in such setups for various reasons.


>  2. you have more control on what C++ features/costs exactly will be used in
> the generated cost

Correct. XSD/e is highly configurable when it comes to C++ features
used as well as features provided by XSD/e (things like validation,
regex support, etc).


>  3. it have no dependencies (not even xerces, can even work without using
> STL)

Correct.


> Are there other differences?

Compared to XSD, XSD/e is more light-weight but also not as powerful as
XSD. Some of the more advanced/convenience features found XSD are not
available in XSD/e.


> Maybe in the kind of interfaces generated?

C++/Hybrid in XSD/e is similar but not the same as C++/Tree in XSD.


> xsd generate STL-like code, I find it useful. If using RTTI and STL makes me
> keep this kind of interface, I'll be happy with it.

C++/Hybrid in XSD/e uses STL in the interface (e.g., to represent strings,
etc) if enabled. Also, iterators in C++/Hybrid conform to the STL interface.


> Last question : I don't find a way to specify something else than auto_ptr
> as smart-pointer type for root objects.
> Is there a way? I'd like to use std::unique_ptr (I'm using recent compilers)
> or std::shared_ptr.

This is a question about XSD, not XSD/e, right? XSD/e does not use auto_ptr.

There is no way to change that in XSD but you can always "strip off"
auto_ptr with the release function. Let's say root() is the parsing
function. Then you can write:

std::unique_ptr<root_t> r (root (...).release ());

Also, std::shared_ptr has a constructor that takes std::auto_ptr. So
you don't even need to call release() in this case:

std::shared_ptr<root_t> r (root (...));

Boris



More information about the xsd-users mailing list