| 1169 | enum ITEM_ESCAPING {ESCAPE_HTML, ESCAPE_URL, ESCAPE_NONE}; |
| 1170 | |
| 1171 | static int processItemTag(layerObj *layer, char **line, shapeObj *shape) |
| 1172 | { |
| 1173 | int i, j; |
| 1174 | |
| 1175 | char *tag, *tagStart, *tagEnd; |
| 1176 | hashTableObj *tagArgs=NULL; |
| 1177 | int tagOffset, tagLength; |
| 1178 | char *encodedTagValue=NULL, *tagValue=NULL; |
| 1179 | |
| 1180 | char *argValue=NULL; |
| 1181 | |
| 1182 | char *name=NULL, *pattern=NULL; |
| 1183 | char *format=NULL, *nullFormat=NULL; |
| 1184 | int precision; |
| 1185 | int uc, lc, commify; |
| 1186 | int escape; |
| 1187 | |
| 1188 | if(!*line) { |
| 1189 | msSetError(MS_WEBERR, "Invalid line pointer.", "processItemTag()"); |
| 1190 | return(MS_FAILURE); |
| 1191 | } |
| 1192 | |
| 1193 | tagStart = findTag(*line, "item"); |
| 1194 | |
| 1195 | if(!tagStart) return(MS_SUCCESS); /* OK, just return; */ |
| 1196 | |
| 1197 | while (tagStart) { |
| 1198 | format = "$value"; /* initialize the tag arguments */ |
| 1199 | nullFormat = ""; |
| 1200 | precision=-1; |
| 1201 | name = pattern = NULL; |
| 1202 | uc = lc = commify = MS_FALSE; |
| 1203 | escape=ESCAPE_HTML; |
| 1204 | |
| 1205 | tagOffset = tagStart - *line; |
| 1206 | |
| 1207 | /* check for any tag arguments */ |
| 1208 | if(getTagArgs("item", tagStart, &tagArgs) != MS_SUCCESS) return(MS_FAILURE); |
| 1209 | if(tagArgs) { |
| 1210 | argValue = msLookupHashTable(tagArgs, "name"); |
| 1211 | if(argValue) name = argValue; |
| 1212 | |
| 1213 | argValue = msLookupHashTable(tagArgs, "pattern"); |
| 1214 | if(argValue) pattern = argValue; |
| 1215 | |
| 1216 | argValue = msLookupHashTable(tagArgs, "precision"); |
| 1217 | if(argValue) precision = atoi(argValue); |
| 1218 | |
| 1219 | argValue = msLookupHashTable(tagArgs, "format"); |
| 1220 | if(argValue) format = argValue; |
| 1221 | |
| 1222 | argValue = msLookupHashTable(tagArgs, "nullformat"); |
| 1223 | if(argValue) nullFormat = argValue; |
| 1224 | |
| 1225 | argValue = msLookupHashTable(tagArgs, "uc"); |
| 1226 | if(argValue && strcasecmp(argValue, "true") == 0) uc = MS_TRUE; |
| 1227 | |
| 1228 | argValue = msLookupHashTable(tagArgs, "lc"); |
no test coverage detected