[xsde-users] XSD/e and xsi:nil support?
Boris Kolpackov
boris at codesynthesis.com
Tue Feb 8 12:41:25 EST 2011
Hi Witek,
Witek Piet <travelwitek at gmail.com> writes:
> <set>
> <config>
> <sampling_enable>true</sampling_enable>
> </config>
> </set>
>
> <get>
> <config>
> <sampling_enable></sampling_enable>
> </config>
> </get>
>
> <response>
> <config>
> <sampling_enable>true</sampling_enable>
> </config>
> </get>
>
> 'set' and 'response' would work fine using the definition of config, but
> 'get' would not work as it does not contain a value. We would rather avoid
> sending a 'dummy' value in 'get'. As I see it the only solution to this, if
> nillable is not possible, is to define an enum (or similar) describing the
> elements of config. This would be used in 'get' to specify which elements of
> config are requested. Do you agree on that?
Yes, I think this is a good idea. I would do something like this:
<simpleType name="config_element">
<restriction base="string">
<enumeration value="sampling_enable"/>
<enumeration value="sampling_rate"/>
</restriction>
</simpleType>
<simpleType name="config_list">
<list itemType="config_element"/>
</simpleType>
<complexType name="get">
<sequence>
<element name="config" type="config_list"/>
</sequence>
</complexType>
Then, your get request would look like this:
<get>
<config>sampling_enable</config>
</get>
Or:
<get>
<config>sampling_enable sampling_rate</config>
</get>
Boris
More information about the xsde-users
mailing list