[wfs-dev] null values

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Fri Oct 27 09:06:08 EDT 2006


Hi list,

how is a WFS supposed to deal with null values?

I can see 3 options (for instance an attribute named PRIORITY):


1) just output an empty element (I guess not the cleanest approach since it
cannot be distinguished from an empty string)

<MYFIRSTITEM>aaa</MYFIRSTITEM>
<PRIORITY></PRIORITY>
<MYTHIRDITEM>zzz</MYTHIRDITEM>

I think this is how Mapserver WFS operates.


2)
Leave out the respective element in the reponse.

<MYFIRSTITEM>aaa</MYFIRSTITEM>
<MYTHIRDITEM>zzz</MYTHIRDITEM>

This is what Ionic WFS does.

3)
An option I have not yet seen, output xsi:nil="true" for the respective
element?

<MYFIRSTITEM>aaa</MYFIRSTITEM>
<PRIORITY xsi:nil="true"></PRIORITY>
<MYTHIRDITEM>zzz</MYTHIRDITEM>

Ofcourse the 1) and 3) behaviour is easier to process (for instance with
XSLT) than the second one.

Should the WFS spec say something about this? Or is it up to the vendor? It
would make life easier if they all did the same thing IMHO. And I guess 3)
is the cleanest approach.

Thanks in advance for any input on this.

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl







More information about the wfs-dev mailing list