Skip to content

Commit 275ecce

Browse files
committed
WFS: Make parsing of gml_optional_items and gml_mandatory_items symmetrical
1 parent 9edae04 commit 275ecce

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

mapgml.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,20 +1972,23 @@ gmlItemListObj *msGMLGetItems(layerObj *layer, const char *metadata_namespaces)
19721972
/* check optional */
19731973
if(numoptionalitems == 1 && strcasecmp("all", optionalitems[0]) == 0) {
19741974
item->minOccurs = 0;
1975-
} else {
1976-
if(nummandatoryitems == 1 && strcasecmp("all", mandatoryitems[0]) == 0) {
1977-
item->minOccurs = 1;
1978-
}
1975+
} else if( numoptionalitems > 0) {
1976+
item->minOccurs = 1;
19791977
for(j=0; j<numoptionalitems; j++) {
19801978
if(strcasecmp(layer->items[i], optionalitems[j]) == 0)
19811979
item->minOccurs = 0;
19821980
}
19831981
}
19841982

19851983
/* check mandatory */
1986-
for(j=0; j<nummandatoryitems; j++) {
1987-
if(strcasecmp(layer->items[i], mandatoryitems[j]) == 0)
1988-
item->minOccurs = 1;
1984+
if(nummandatoryitems == 1 && strcasecmp("all", mandatoryitems[0]) == 0) {
1985+
item->minOccurs = 1;
1986+
} else if( nummandatoryitems > 0) {
1987+
item->minOccurs = 0;
1988+
for(j=0; j<nummandatoryitems; j++) {
1989+
if(strcasecmp(layer->items[i], mandatoryitems[j]) == 0)
1990+
item->minOccurs = 1;
1991+
}
19891992
}
19901993

19911994
/* check default */

0 commit comments

Comments
 (0)