I have created a schema to write out some configuration data, and the OutPort
element uses an abstract complex type (it can be a Message, Discrete,
Continuous, Array, etc...).
I use the provided XSD.exe tool with the /c option to generate the
XML-attribute'd classes.
When the data is written to disk is looks like this:
<OutPort xmlns:q1="urn:MicroMax:MxVDev:3.x"
xsi:type="q1:SignalDiscrete" Name="brd0/di0">
<Minimum>0</Minimum>
<Maximum>1</Maximum>
</OutPort>
<OutPort xmlns:q2="urn:MicroMax:MxVDev:3.x"
xsi:type="q2:SignalDiscrete" Name="brd0/di1">
<Minimum>0</Minimum>
<Maximum>1</Maximum>
</OutPort>
<OutPort xmlns:q3="urn:MicroMax:MxVDev:3.x"
xsi:type="q3:SignalDiscrete" Name="brd0/di2">
<Minimum>0</Minimum>
<Maximum>1</Maximum>
</OutPort>
This continues on for all the signals, with the q#'s ever increasing.
It seems like anyone that works with abstract types must have run into this,
and hopefully it's something simple that I need to.
I tried setting various parts of the XSD to have unqualified names, but from
what I've read, xsi:type's must be qualified.
Is there a way to force an extra xmlns entry in the root node so that the
serializer doesn't have to create all these redundant q# namespace's?
Ideally I'd like all the q#:'s replaced with mxv: and an
xmlns:mxv="urn:MicroMax:MxVDev:3.x" to appear on the root node.
Thanks in advance for any ideas or direction.