[xsd-users] Complex Custom types

Boris Kolpackov boris at codesynthesis.com
Mon Dec 8 10:47:48 EST 2008


Hi Patrick,

Paquette, Patrick <PaquetP at navcanada.ca> writes:

> --history lesson--
> [...]
> --end history lesson--

Thanks for the heads up.


> I'm trying to avoid the need to define the custom types as template
> classes, as I "believe" I shouldn't have to (this is where I'm probably
> wrong, but let's see what everybody else says...)

No, you are quite right. If you can split your schemas on the 
inheritance boundaries, then you don't need the template approach.


> static
> const ::xsd::cxx::tree::type_factory_initializer< 0, char, Diagnose_base >
> _xsd_Diagnose_base_type_factory_init (
>   "Diagnose",
>   "");
> 
> When I parse a Message that has a "Diagnose" message in it, it creates a
> new instance of Diagnose_base instead of Diagnose - which I don't want.
> 
> If I change the 3rd argument of the template initializaiton from
> Diagnose_base to Diagnose, everything works great...but then I'm
> modifying generated source...
> 
> Is there a flag I'm missing to have this done by xsd?  Could this be a
> bug?  Am I using this tool in a way it was never intended?

This is a bug that was also discovered by Bill Pringlemeir just a few
days ago:

http://codesynthesis.com/pipermail/xsd-users/2008-December/002086.html

The type in the factory init code above should be Diagnose, not 
Diagnose_base. We have fixed this problem for the next release of
XSD and I can build you a pre-release binary with the fix if you
would like (just let me know which platform(s) you need).

Alternatively, you can use Bill's little sed script to fix this up
in the generated code until XSD 3.3.0 is out:

http://codesynthesis.com/pipermail/xsd-users/2008-December/002094.html

Boris




More information about the xsd-users mailing list