[xsd-users] Differencies between xsd and xsde

Ivan Le Lann ivan.lelann at free.fr
Tue Jun 14 04:43:32 EDT 2011


----- "Klaim - Joël Lamotte" <mjklaim at gmail.com> a écrit :

> Hi,
> 
> I've been using xsd for some time but I've just discovered xsde.
> 
> There is no comparison page but from what I understand from reading
> the docs
> so far:
> 
>  1. it targets embedded softwares
>  2. you have more control on what C++ features/costs exactly will be
> used in
> the generated cost
>  3. it have no dependencies (not even xerces, can even work without
> using
> STL)
> 
> Can you confirm 3. ?
> If it's correct, it might be more interesting for me than using xsd.
> 
> Are there other differences?
> Maybe in the kind of interfaces generated?
> 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.

The code is very similar, but still you cannot switch from xsd to xsde 
without changing your code in some places: no more auto_ptr<T> and optional<T>.
To be able to switch between xsd and xsde, I had to write few simple macros:
XSD_DETACH, XSD_OPTIONAL_PRESENT, XSD_OPTIONAL_MAKE_PRESENT, etc.
Nothing difficult, but not exactly pretty.

Also a few one-line functions to deal with raw pointer/auto_ptr differences 
("create", "move_ptr") and a "eval" for transparent xsd::optional handling.

By the way, I wonder if xsde should not return pointers for optional members.
That would be more similar to xsd's optional<T>.

> 
> 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.

If you're talking about XSD/e Hybrid, I have written a patch that allow you to 
specify the type of pointer used for any type by template specialization.
This is poorly tested (ie. only by me), not really used, and highly unlikely 
to be merged in XSD/e. Anyway: http://bitbucket.org/liukahr/xsde

Ivan



More information about the xsd-users mailing list