Skip to content

Commit

Permalink
WFS: Make parsing of gml_optional_items and gml_mandatory_items symme…
Browse files Browse the repository at this point in the history
…trical
  • Loading branch information
rouault committed Nov 20, 2013
1 parent 9edae04 commit 275ecce
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions mapgml.c
Expand Up @@ -1972,20 +1972,23 @@ gmlItemListObj *msGMLGetItems(layerObj *layer, const char *metadata_namespaces)
/* check optional */
if(numoptionalitems == 1 && strcasecmp("all", optionalitems[0]) == 0) {
item->minOccurs = 0;
} else {
if(nummandatoryitems == 1 && strcasecmp("all", mandatoryitems[0]) == 0) {
item->minOccurs = 1;
}
} else if( numoptionalitems > 0) {
item->minOccurs = 1;
for(j=0; j<numoptionalitems; j++) {
if(strcasecmp(layer->items[i], optionalitems[j]) == 0)
item->minOccurs = 0;
}
}

/* check mandatory */
for(j=0; j<nummandatoryitems; j++) {
if(strcasecmp(layer->items[i], mandatoryitems[j]) == 0)
item->minOccurs = 1;
if(nummandatoryitems == 1 && strcasecmp("all", mandatoryitems[0]) == 0) {
item->minOccurs = 1;
} else if( nummandatoryitems > 0) {
item->minOccurs = 0;
for(j=0; j<nummandatoryitems; j++) {
if(strcasecmp(layer->items[i], mandatoryitems[j]) == 0)
item->minOccurs = 1;
}
}

/* check default */
Expand Down

0 comments on commit 275ecce

Please sign in to comment.