[xsde-users] XSD/e and xsi:nil support?

Witek Piet travelwitek at gmail.com
Wed Feb 9 07:40:26 EST 2011


Once again thanks for answering! ;-) The only thing that bothers me about
this approach is its maintainability, i.e. the enum has to be kept in sync
with the data structure.

Best regards,
Witek

On Tue, Feb 8, 2011 at 6:41 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> 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