EXTERNAL: Re: [xsd-users] Way To Determine Fully Qualified Type?

Boris Kolpackov boris at codesynthesis.com
Thu Dec 1 07:36:42 EST 2011


Hi Jason,

Friess, Jason <jason.friess at lmco.com> writes:

> We do have polymorphism enabled and the type in question is derived 
> from a polymorphic base. We are very interested in an approach you 
> can point us to to get this information!

The other requirement that I forgot to mention is that you need to
generate serialization support (--generate-serialization) since
internally this information is only needed for serialization.

If all the requirements are met, then you can use the schema_type()
function I wrote:

http://www.codesynthesis.com/~boris/tmp/xsd/schema-type.tar.gz

It returns polymorphic type schema name in the form "namespace#name".
If there is no entry for this type, then it returns an empty string:

#include "schema-type.hxx"

type& x = ... // Some XSD-generated polymorphic class instance.

std::string type (schema_type (x));

It should be pretty straightforward to modify this function if
you need the namespace/name parts returned separately (e.g.. as
std::pair).

Boris



More information about the xsd-users mailing list