Skip to content
Permalink
Browse files

WFS: Make parsing of gml_optional_items and gml_mandatory_items symme…

…trical
  • Loading branch information
rouault committed Nov 20, 2013
1 parent 9edae04 commit 275eccec0726d7d908838fa53170917499c17c4c
Showing with 10 additions and 7 deletions.
  1. +10 −7 mapgml.c
@@ -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 */

0 comments on commit 275ecce

Please sign in to comment.
You can’t perform that action at this time.