[xsd-users] Way To Determine Fully Qualified Type?
Boris Kolpackov
boris at codesynthesis.com
Tue Nov 29 10:05:55 EST 2011
Hi Jason,
Friess, Jason <jason.friess at lmco.com> writes:
> Is there a way to determine the fully qualified type (including XSD
> namespace) of an object? Specifically I'm wondering if there is a method
> that I can call on an instance of one of the classes generated from my XSD's
> by CodeSynthesis where the return type of this method would be a string
> representing the fully qualified type.
No, this information is not generally available. There is a way to get
it if you have polymorphism enabled (--generate-polymorphic option) and
the type in question is polymorphic or is derived from a polymorphic
base (--polymorphic-type option). Internally this information is used
to set the xsi:type attributes. Let me know if you are interested in
this approach and I will provide more information.
Note also that XML Schema has a notion of anonymous types. While they
are translated to named C++ classes, they don't have XML Schema names.
Boris
More information about the xsd-users
mailing list