- Timestamp:
- Feb 25, 2018, 3:06:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/request_parser.c
r864 r867 905 905 } 906 906 907 908 907 while (cur4 != NULL) 909 908 { … … 979 978 980 979 if (strcasecmp (test->value, "base64") != 0) 981 { 980 { 982 981 xmlChar *mv = xmlNodeListGetString (doc, 983 982 cur4->xmlChildrenNode, … … 1007 1006 &buffersize, 1008 1007 "utf-8", 0); 1008 xmlFreeDoc (doc1); 1009 1009 } 1010 1010 else … … 1022 1022 addIntToMap (tmpmaps->content, "size", 1023 1023 buffersize); 1024 xmlFreeDoc (doc1);1025 1024 }else{ 1026 xmlNodePtr cur5 = cur4->children; 1027 while (cur5 != NULL 1028 && cur5->type != XML_CDATA_SECTION_NODE) 1029 cur5 = cur5->next; 1030 if (cur5 != NULL 1031 && cur5->type == XML_CDATA_SECTION_NODE){ 1032 xmlFree(mv); 1033 mv=xmlStrdup(cur5->content); 1025 if(xmlStrcasecmp 1026 (cur4->name, BAD_CAST "BoundingBoxData") == 0){ 1027 xmlDocPtr doc1 = xmlNewDoc(BAD_CAST "1.0"); 1028 int buffersize; 1029 xmlDocSetRootElement(doc1,cur4); 1030 xmlDocDumpFormatMemoryEnc(doc1,&mv, 1031 &buffersize, 1032 "utf-8",0); 1033 addIntToMap (tmpmaps->content, "size", 1034 buffersize); 1035 xmlParseBoundingBox(main_conf,&tmpmaps->content,doc1); 1036 }else{ 1037 xmlNodePtr cur5 = cur4->children; 1038 while (cur5 != NULL 1039 && cur5->type != XML_ELEMENT_NODE 1040 && cur5->type != XML_CDATA_SECTION_NODE) 1041 cur5 = cur5->next; 1042 if (cur5 != NULL 1043 && cur5->type != XML_CDATA_SECTION_NODE) 1044 { 1045 xmlDocPtr doc1 = xmlNewDoc (BAD_CAST "1.0"); 1046 int buffersize; 1047 xmlDocSetRootElement (doc1, cur5); 1048 xmlDocDumpFormatMemoryEnc (doc1, &mv, 1049 &buffersize, 1050 "utf-8", 0); 1051 addIntToMap (tmpmaps->content, "size", 1052 buffersize); 1053 } 1054 else /*if (cur5 != NULL 1055 && cur5->type == XML_CDATA_SECTION_NODE)*/{ 1056 xmlFree(mv); 1057 mv=xmlStrdup(cur5->content); 1058 } 1034 1059 } 1035 1060 } … … 1102 1127 } 1103 1128 return 1; 1129 } 1130 1131 /** 1132 * Parse a BoundingBoxData node 1133 * 1134 * http://schemas.opengis.net/ows/1.1.0/owsCommon.xsd: BoundingBoxType 1135 * 1136 * A map to store boundingbox information will contain: 1137 * - LowerCorner : double double (minimum within this bounding box) 1138 * - UpperCorner : double double (maximum within this bounding box) 1139 * - crs : URI (Reference to definition of the CRS) 1140 * - dimensions : int 1141 * 1142 * @param main_conf the conf maps containing the main.cfg settings 1143 * @param request_inputs the map storing KVP raw value 1144 * @param doc the xmlDocPtr containing the BoudingoxData node 1145 * @return a map containing all the bounding box keys 1146 */ 1147 int xmlParseBoundingBox(maps** main_conf,map** current_input,xmlDocPtr doc){ 1148 xmlNode *root_element = xmlDocGetRootElement(doc); 1149 for(xmlAttrPtr attr = root_element->properties; NULL != attr; attr = attr->next){ 1150 xmlChar *val = xmlGetProp (root_element, BAD_CAST attr->name); 1151 addToMap(*current_input,(char*)attr->name,(char*)val); 1152 xmlFree(val); 1153 xmlNodePtr cur = root_element->children; 1154 while(cur!=NULL && cur->type != XML_ELEMENT_NODE) 1155 cur=cur->next; 1156 while(cur!=NULL && cur->type==XML_ELEMENT_NODE){ 1157 xmlChar *val = 1158 xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); 1159 addToMap(*current_input,(char*)cur->name,(char*)val); 1160 cur=cur->next; 1161 xmlFree(val); 1162 while(cur!=NULL && cur->type != XML_ELEMENT_NODE) 1163 cur=cur->next; 1164 } 1165 } 1104 1166 } 1105 1167
Note: See TracChangeset
for help on using the changeset viewer.