[xsd-users] XSD Generated Class Customization

Southworth Damon (AA-AS/EOS32) damon.southworth at uk.bosch.com
Thu Feb 22 12:13:23 EST 2018


Hi,

> On 22 Feb 2018, at 16:53, Boris Kolpackov <boris at codesynthesis.com> wrote:
> 
> I assume you are talking about XSD-generated classes that you have
> customized using the mechanisms described here:
> 
> http://wiki.codesynthesis.com/Tree/Customization_guide
> 

Yes, that is correct, we use the C++11 complex pattern.

> Hm, since you have customized them, don't you have full control
> over all the constructors that you define in them? I am not sure
> I understand what the problem is.

Yes, we can generate custom constructors where required and perform custom operations within them but is there any mechanism that I can use to add extra parameters to these custom constructors that I have control over when when the object is instantiated?

> Or is the problem in passing that extra parameter along to
> member's constructors?
> 

Yes, how would I pass and assign custom parameters to the custom constructors?  Currently the parameters are the same as the parent class and these are passed down. I’d like to add an additional parameter that the custom constructor can use but I can’t see how we can add custom parameters as the objects are instantiated and the constructors called when the XML data is being parsed. I don’t see any mechanism to get extra constructor parameters that we can control and assign into the autogenerated XML parsing code.

Damon.




More information about the xsd-users mailing list