File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -1972,20 +1972,23 @@ gmlItemListObj *msGMLGetItems(layerObj *layer, const char *metadata_namespaces)
1972
1972
/* check optional */
1973
1973
if (numoptionalitems == 1 && strcasecmp ("all" , optionalitems [0 ]) == 0 ) {
1974
1974
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 ;
1979
1977
for (j = 0 ; j < numoptionalitems ; j ++ ) {
1980
1978
if (strcasecmp (layer -> items [i ], optionalitems [j ]) == 0 )
1981
1979
item -> minOccurs = 0 ;
1982
1980
}
1983
1981
}
1984
1982
1985
1983
/* 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
+ }
1989
1992
}
1990
1993
1991
1994
/* check default */
You can’t perform that action at this time.
0 commit comments