[xsd-users] --custom-type mapping to fundamental types

Boris Kolpackov boris at codesynthesis.com
Mon Feb 4 10:04:25 EST 2008


Hi Francis,

Francis Rammeloo <francis.rammeloo at gmail.com> writes:

> <xsd:simpleType name="time">
>   <xsd:restriction base="xsd:int" />
> </xsd:simpleType>
>
> The C++/Tree mapping tool would translate this normally to a class.
> However, in order to reduse verbosity I used following command line
> option:
>
> --custom-type time=int
>
> The generated code however does not compile.

Unfortunately this is not (yet) supported. XSD assumes that types that
are by default mapped to user-defined types, when customized, are also
mapped to user-defined types. The same for fundamental types.

It won't be very hard to allow the --custom-type option to also specify
whether the target type is user-defined or fundamental. The problem is
that currently the knowledge supplied with the --custom-type option is
only available in the current translation. So if you defined your time
type in one schema file and used it in the other, then currently you
only need to provide the --custom-type option when compiling the
defining schema. As a result when compiling the schema the is using
the type, there no way to know if time is a user-defined or fundamental
type.

Boris




More information about the xsd-users mailing list