Show
Ignore:
Timestamp:
07/15/10 08:26:47 (19 months ago)
Author:
ol
Message:

Remove test on PK related to XSD schema on Describe Feature Type?. Add nillable parameter. Handle not null with a default value (a sequence for instance). Related to #50

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/wfs/wfs_describe.c

    r311 r312  
    3636                             buffer * layer_name) 
    3737{ 
    38     buffer *id_name; 
    3938    array *table; 
    4039    array_node *an; 
     
    5554    fprintf(o->output, "   <xs:sequence>\n"); 
    5655 
    57     id_name = ows_psql_id_column(o, layer_name); 
    5856    table = ows_psql_describe_table(o, layer_name); 
    5957 
     
    6260    /* Output the description of the layer_name */ 
    6361    for (an = table->first; an != NULL; an = an->next) { 
    64         if (!id_name || (id_name && !buffer_cmp(an->key, id_name->buf))) { 
    6562            fprintf(o->output, "    <xs:element name ='"); 
    6663            buffer_flush(an->key, o->output); 
     
    6865 
    6966            if (in_list(mandatory_prop, an->key)) 
    70                 fprintf(o->output, "minOccurs='1' "); 
     67                fprintf(o->output, "nillable='false' minOccurs='1' "); 
    7168            else 
    72                 fprintf(o->output, "minOccurs='0' "); 
     69                fprintf(o->output, "nillable='true' minOccurs='0' "); 
    7370 
    7471            fprintf(o->output, "maxOccurs='1'/>\n"); 
    75         } 
    7672    } 
    7773