[mapserver-users] WFS layer - XML/JSON safe chars

thomas bonfort thomas.bonfort at gmail.com
Fri Apr 15 07:10:48 PDT 2016


Ian,
data coming from the datasource should be encoded by mapserver, *unless*
their field has been added to the layer via the "gml_xml_items" metadata
entry (instead of the usual "gml_include_items")

--
thomas

On 15 April 2016 at 15:54, Ian Walberg <ian.walberg at airborne.aero> wrote:

> Jukka,
>
>
>
> I am not sure I understand the test you did.
>
>
>
> The data we are referring to is from the database field for the individual
> features name.
>
>
>
> Regards
>
>
>
> Ian
>
>
>
> *From:* Rahkonen Jukka (MML) [mailto:jukka.rahkonen at maanmittauslaitos.fi]
> *Sent:* Thursday, April 14, 2016 10:19 PM
>
> *To:* Ian Walberg <ian.walberg at airborne.aero>; MapserverList OSGEO <
> mapserver-users at lists.osgeo.org>
> *Subject:* Re: WFS layer - XML/JSON safe chars
>
>
>
> Hi Ian,
>
>
>
> Thanks for the clarification.
>
> I made a simple test by adding an abstract into layer metadata. This shows
> “test ä” as an abstract
>
> "wfs_abstract" "test ä”
>
>
>
> This one shows an empty abstract
>
> "wfs_abstract" "test ä &"
>
>
>
> So it looks like Mapserver doesn’t know to convert “&” into “&” for
> XML.
>
>
>
> -Jukka Rahkonen-
>
>
>
> Ian Walberg wrote:
>
>
>
> Jukka,
>
>
>
> Our question was for the data/text read from the database and then
> published as XML by the WFS service.
>
>
>
> So a pub with the name ‘Dog & bone’ created illegal xml as the & is not
> converted to &
>
>
>
> Regards
>
>
>
> Ian
>
>
>
> *From:* Rahkonen Jukka (MML) [mailto:jukka.rahkonen at maanmittauslaitos.fi
> <jukka.rahkonen at maanmittauslaitos.fi>]
> *Sent:* Thursday, April 14, 2016 3:10 PM
> *To:* Ian Walberg <ian.walberg at airborne.aero>; MapserverList OSGEO <
> mapserver-users at lists.osgeo.org>
> *Subject:* Re: WFS layer - XML/JSON safe chars
>
>
>
> Hi,
>
>
>
> You can’t have & in feature type names or attribute names in WFS because
> they are defined in the XML schema to be “QName”. The prefix and LocalPart
> are of type NCName https://en.wikipedia.org/wiki/QName and from
> http://stackoverflow.com/questions/1631396/what-is-an-xsncname-type-and-when-should-it-be-used
>
>
>
> The practical restrictions of NCName are that it cannot contain several
> symbol characters like :, @, $, %, &, /, +, ,, ;, whitespace characters
> or different parenthesis. Furthermore an NCName cannot begin with a number,
> dot or minus character although they can appear later in an NCName.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* mapserver-users [
> mailto:mapserver-users-bounces at lists.osgeo.org
> <mapserver-users-bounces at lists.osgeo.org>] *Puolesta *Ian Walberg
> *Lähetetty:* 14. huhtikuuta 2016 19:23
> *Vastaanottaja:* MapserverList OSGEO
> *Aihe:* [mapserver-users] WFS layer - XML/JSON safe chars
>
>
>
> Folks,
>
>
>
> Can mapserver produce XML or JSON safe characters for WFS served data or
> do we need to ensure the source data has the escaped values.
>
>
>
> We got tripped up today as there were some ‘&’ in our names which we had
> not considered.
>
>
>
> Thanks
>
>
>
> Ian
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160415/ab6c89db/attachment.html>


More information about the mapserver-users mailing list