[OSM-dev] Tags with namespace: and invalid XML from WFS service

yvecai yvecai at gmail.com
Tue Nov 1 17:33:56 GMT 2011


issue problem namespace colons : osm wfs postgresql postgis openlayer 
geoserver

Just to be sure somebody find this mail from a search engine, It would 
have help me months ago with the same :)

Yves

On 01. 11. 11 15:07, Jukka Rahkonen wrote:
> Hi,
>
> This is for information if somebody gets interested in setting up WFS
> services. If OSM data is imported into PostGIS with osm2pgsql the
> resulting attribute names containing colons (addr:streetname etc.) must be
> renamed. Otherwise WFS server is creating invalid XML. Here is a start of
> the WFS feature type schema without renaming.
>
> <xs:complexType name="osm_pointType">
> <xs:complexContent>
> <xs:extension base="gml:AbstractFeatureType">
> <xs:sequence>
> <xs:element name="osm_id" type="int" nillable="true" minOccurs="0"
> maxOccurs="1"/>
> maxOccurs="1"/><xs:element name="access" type="string" nillable="true"
> minOccurs="0" maxOccurs="1"/>
> <xs:element name="addr:housenumber" type="string" nillable="true"
> minOccurs="0" maxOccurs="1"/>
>
> What happens is that osm2pgsql is converting some tags into attributes,
> and WFS server is converting attributes into XML elements. "name" in XML
> element is defined to be of type NCName
> (http://www.w3schools.com/schema/el_element.asp) and NCName does not allow
> the use of colon character
> (http://stackoverflow.com/questions/1631396/what-is-an-xsncname-type-and-when-should-it-be-used).
> Therefore addr:housenumber will lead to invalid XML.
>
> There is nothing wrong with the OSM XML format, this is just a reminder
> for those who would like use WFS or explode tags into<xs:element for some
> other reason.
>
> -Jukka Rahkonen-
>
>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>




More information about the dev mailing list