[xsde-users] base class for complextype classes?

Boris Kolpackov boris at codesynthesis.com
Tue Apr 5 09:18:09 EDT 2011


Hi,

dv <dv7777 at gmail.com> writes:

> However, the generated class does not have a base class - in XSD, it  
> does (xml_schema::type). This is bad

We didn't introduce a common base class (which would probably need
to define virtual functions to be useful) to avoid overhead. So
while this is "bad" for you, it might not be "bad" for the majority
of the XSD/e users.


> Is there a way to specify a base class for all complex types?

There are two ways that I can think of:

1. Introduce a common base type in the schema.

2. Customize every generated type to derive from a common base.
   You could probably use a wrapper class template to achieve
   this. See the --custom-type option and the relevant sections
   in the manual.


> I looked into the polymorphism options, but I am not sure they give
> me what I want.

No, this won't help you.

Boris



More information about the xsde-users mailing list