Is fid beginning with a number valid in WFS?

Rahkonen Jukka Jukka.Rahkonen at MMMTIKE.FI
Mon May 21 07:12:30 EDT 2007


Hi,
 
After reading some articles from internet and elsewhere I have started to think that fid starting with a number is not valid.
 
a) An excerpt from gml 2.1.2 feature.xsd schema:
 <documentation>
        An abstract feature provides a set of common properties. A concrete 
        feature type must derive from this type and specify additional 
        properties in an application schema. A feature may optionally 
        possess an identifying attribute ('fid').
      </documentation>
    </annotation>
    <sequence>
      <element ref="gml:description" minOccurs="0"/>
      <element ref="gml:name" minOccurs="0"/>
      <element ref="gml:boundedBy" minOccurs="0"/>
      <!-- additional properties must be specified in an application schema -->
    </sequence>
    <attribute name="fid" type="ID" use="optional"/>
 
So fid seems to be of type "ID"
 
b) Reference http://matcmadison.edu/schmidt/xml/dtdattr.htm
says: 

ID is used to uniquely identify an element in the [XML] document

*	It cannot be repeated within the document
*	Cannot have a fixed default value (#FIXED), since these cannot change
*	Most IDs use #REQUIRED for a default value, since an ID is required
*	ID values must conform to the rules for valid XML names
*	ID must be a valid XML name - must start with a letter or underscore
*	An ID using a pure number, such as a credit card number, social security number, telephone number or any other pure numeric value is not valid

There seem to exist WFS clients which are strict in validating the GML returned from the server. Shouldn't there be some mechanism in Mapserver WFS that automatically generates some valid character in the beginning of fid?  At least in our database the most suitable columns that could be used as basis for fid are numeric, primary key taken from sequence or the kind. Now taking the most suitable column for fid by adddint "wfs_featureid" "ID" to LAYER METADATA section leads to non-standard result. Adding an underscore should make it valid for any client.  Do WFS specialists agree?
 
Regards,
 
-Jukka Rahkonen-
 
 
 
 
 

________________________________

Lähettäjä: Rahkonen Jukka
Lähetetty: su 20.5.2007 18:35
Vastaanottaja: MAPSERVER-USERS at LISTS.UMN.EDU
Aihe: Re: [UMN_MAPSERVER-USERS] Is fid beginning with a number valid in WFS?


Hi, 
 
To avoid confuse, the difference between ms:roads and lv:towns was due to cut and paste error.  They should be
 
Mapserver:
<gml:featureMember>
 <ms:roads fid="71">

Geoserver:
<gml:featureMember>
 <lv:roads fid="roads.71">

-Jukka-
 
>Hi,

>I am trying to serve the same data through Mapserver WFS and Geoserver WFS.  Both are making GML packege when >GetFeature is requested, but my WFS client accepts only the on sent by Geoserver.  Only real difference I can see is in fid.  >While Geoserver always inserts something in the beginning of the fid to be sure that is does not start with number >character, Mapserver does not. I wonder if fid starting with a number is valid according to WFS standard or not. 

>Mapserver:
><gml:featureMember>
 ><ms:roads fid="71">

>Geoserver:
><gml:featureMember>
> <lv:towns fid="roads.71">

>Regards,

>-Jukka Rahkonen-



More information about the mapserver-users mailing list