[xsd-users] Differencies between xsd and xsde

Klaim - Joël Lamotte mjklaim at gmail.com
Tue Jun 14 07:46:22 EDT 2011


2011/6/14 Ivan Le Lann <ivan.lelann at free.fr>

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

That's interesting!


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

I agree.


>
> >
> > 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
>
>
Thanks Ivan, that's really helpful!
I'll not use xsde in the end but it's a patch that I'd like to see in xsd
too.
So there ARE smart pointers generated in some cases in xsd/e, right?

Joël Lamotte


More information about the xsd-users mailing list