Hi all,
I'm trying to use the encodeIfEmpty element to encode an empty element when the
value in the underlying database is null, e.g.
.
.
<AttributeMapping>
<targetAttribute>positionalAccuracy</targetAttribute>
<sourceExpression><OCQL>POSITIONALACCURACY</OCQL></sourceExpression>
<encodeIfEmpty>true</encodeIfEmpty>
</AttributeMapping>
.
.
I need the output element to be of the form <gsmlp:positionalAccuracy/> for
null values, although the element is being skipped, i.e. it doesn't appear at
all, and the resulting feature XML is invalid against the application schema.
Has anyone gotten this to work, or am I misunderstanding the documentation -
"The encodeIfEmpty element will determine if an attribute will be encoded if it
contains a null or empty value."?
I've found work arounds using filter expressions, e.g.
<sourceExpression><OCQL>if_then_else(isNull(PARENTBOREHOLE_URI),
'',PARENTBOREHOLE_URI)</OCQL></sourceExpression>, although the element becomes
non-queryable.
I'm using GeoServer 2.9.0 with the 2.9.0 app schema plugin, and have tested
against Oracle and PostgreSQL databases.
Regards,
Aaron.
Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is
intended only for the person or entity to which it is addressed. If you are not
the intended recipient, then you have received this e-mail by mistake and any
use, dissemination, forwarding, printing or copying of this e-mail and its file
attachments is prohibited. The security of emails transmitted cannot be
guaranteed; by forwarding or replying to this email, you acknowledge and accept
these risks.
-------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users