[wfs-dev] null values

John Herring john.herring at oracle.com
Fri Oct 27 09:34:48 EDT 2006


Bart, 

	Most systems have their own way of dealing with
NULLs. In XML is seems to be simply leaving out the element.
Which leads to an interesting philosophic question about
your proposal.  

	If one writes:

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

	And the original schema calls for PRIORITY's
minOccurs to be 1, have you violated the intent of the
schema? In SQL you get to put in "NOT NULL" and in XML you
get to put in "minOccurs=1" and force a value. In either of
your suggestions with a PRIORITY element, you are not in
violation of a  "minOccurs=1" but you are in violation of
the semantics of not allowing a NULL. 

	Personally, I thing that IONIC is right and the only
way to do this is the way the XML gurus meant us to do it,
which is with minOccurs=0 and missing elements. On the other
hand, GML's multiple  flavors of NULL does something else
altogether, but at least you can force an application schema
not to use it (the equivalent of a NOT NULL). 

Regards,
John

You do what you can when you can because you can. 

The opinions expressed in this email are purely my own and
do not necessarily represent the opinions of any
organization
or otherwise sane person or persons.

John R. Herring
Architect, Spatial Products
Oracle Corporation
One Oracle Drive
Nashua, New Hampshire 03062
ph: 1 603 897 3216
fx: 1 603 897 3334

Annue cœptis - Novus Ordo Seclorum


-----Original Message-----
From:
wfs-dev-bounces+john.herring=oracle.com at opengeospatial.org
[mailto:wfs-dev-bounces+john.herring=oracle.com at opengeospati
al.org] On Behalf Of Bart van den Eijnden (OSGIS)
Sent: Friday, October 27, 2006 9:06 AM
To: wfs-dev at opengeospatial.org
Subject: [wfs-dev] null values

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





_______________________________________________
wfs-dev mailing list
wfs-dev at opengeospatial.org
https://mail.opengeospatial.org/mailman/listinfo/wfs-dev




More information about the wfs-dev mailing list