Try:

<OCQL>if_then_else(equalTo(CAT_DESC, 'No Name'), Expression.Nil, 
CAT_DESC)</OCQL>

I found this in Rini's polymorphism.xml (used in PolymorphismWfsTest, in 
the feature with id=f4) but I have no idea how she found it! If it 
works, we should document it.

xs:nillable means that an element with a non-empty content model (e.g. 
at least one property with minOccurs>=1) can be encoded empty but with 
am xs:nil="true" attribute. We do not support this. All the schemas we 
use instead have properties that can be omitted, a content model that 
can be empty, or a community profile to use a xlink:href to a special 
URI to represent a missing value. The if_then_else above should let you 
skip an optional property.

Kind regards,
Ben.


On 21/09/10 22:55, Tara Athan wrote:
> Thanks for all these links. I have almost managed to get the syntax I am 
> looking for. I am still stuck on setting a field to NULL.
> This expression parses
> <OCQL>if_then_else(equalTo(CAT_DESC, 'No Name'), 'NULL', CAT_DESC)</OCQL>
>
> This does not
> <OCQL>if_then_else(equalTo(CAT_DESC, 'No Name'), NULL, CAT_DESC)</OCQL>
>
> Am I approaching this wrong?
>
> As I understand it, "nillable" in GML means the element may be missing. Is 
> there some other way to cause  an element to be conditionally omitted?
>
> Tara

-- 
Ben Caradoc-Davies <ben.caradoc-dav...@csiro.au>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to