[xsd-users] XSD Generated Class Customization

Boris Kolpackov boris at codesynthesis.com
Fri Feb 23 09:41:05 EST 2018


Southworth Damon (AA-AS/EOS32) <damon.southworth at uk.bosch.com> writes:

> 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.

Yeah, I don't think there is a clean way to do it. The two approaches that
I can think of:

1. Use a global (potentially thread-local) variable.

2. In case of parsing constructors, I think you can attach custom data
   to the Xerces-C++ DOM.

Boris



More information about the xsd-users mailing list