Changeset 866 for trunk/zoo-project/zoo-kernel/request_parser.c
- Timestamp:
- Feb 25, 2018, 2:49:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/request_parser.c
r836 r866 997 997 &buffersize, 998 998 "utf-8", 0); 999 xmlFreeDoc (doc1); 999 1000 } 1000 1001 else … … 1012 1013 addIntToMap (tmpmaps->content, "size", 1013 1014 buffersize); 1014 xmlFreeDoc (doc1);1015 1015 }else{ 1016 xmlNodePtr cur5 = cur4->children; 1017 while (cur5 != NULL 1018 && cur5->type != XML_CDATA_SECTION_NODE) 1019 cur5 = cur5->next; 1020 if (cur5 != NULL 1021 && cur5->type == XML_CDATA_SECTION_NODE){ 1022 xmlFree(mv); 1023 mv=xmlStrdup(cur5->content); 1016 if(xmlStrcasecmp 1017 (cur4->name, BAD_CAST "BoundingBoxData") == 0){ 1018 xmlDocPtr doc1 = xmlNewDoc(BAD_CAST "1.0"); 1019 int buffersize; 1020 xmlDocSetRootElement(doc1,cur4); 1021 xmlDocDumpFormatMemoryEnc(doc1,&mv, 1022 &buffersize, 1023 "utf-8",0); 1024 addIntToMap (tmpmaps->content, "size", 1025 buffersize); 1026 xmlParseBoundingBox(main_conf,&tmpmaps->content,doc1); 1027 }else{ 1028 xmlNodePtr cur5 = cur4->children; 1029 while (cur5 != NULL 1030 && cur5->type != XML_CDATA_SECTION_NODE) 1031 cur5 = cur5->next; 1032 if (cur5 != NULL 1033 && cur5->type == XML_CDATA_SECTION_NODE){ 1034 xmlFree(mv); 1035 mv=xmlStrdup(cur5->content); 1036 } 1024 1037 } 1025 1038 } … … 1092 1105 } 1093 1106 return 1; 1107 } 1108 1109 /** 1110 * Parse a BoundingBoxData node 1111 * 1112 * http://schemas.opengis.net/ows/1.1.0/owsCommon.xsd: BoundingBoxType 1113 * 1114 * A map to store boundingbox information will contain: 1115 * - LowerCorner : double double (minimum within this bounding box) 1116 * - UpperCorner : double double (maximum within this bounding box) 1117 * - crs : URI (Reference to definition of the CRS) 1118 * - dimensions : int 1119 * 1120 * @param main_conf the conf maps containing the main.cfg settings 1121 * @param request_inputs the map storing KVP raw value 1122 * @param doc the xmlDocPtr containing the BoudingoxData node 1123 * @return a map containing all the bounding box keys 1124 */ 1125 int xmlParseBoundingBox(maps** main_conf,map** current_input,xmlDocPtr doc){ 1126 xmlNode *root_element = xmlDocGetRootElement(doc); 1127 for(xmlAttrPtr attr = root_element->properties; NULL != attr; attr = attr->next){ 1128 xmlChar *val = xmlGetProp (root_element, BAD_CAST attr->name); 1129 addToMap(*current_input,(char*)attr->name,(char*)val); 1130 xmlFree(val); 1131 xmlNodePtr cur = root_element->children; 1132 while(cur!=NULL && cur->type != XML_ELEMENT_NODE) 1133 cur=cur->next; 1134 while(cur!=NULL && cur->type==XML_ELEMENT_NODE){ 1135 xmlChar *val = 1136 xmlNodeListGetString (doc, cur->xmlChildrenNode, 1); 1137 addToMap(*current_input,(char*)cur->name,(char*)val); 1138 cur=cur->next; 1139 xmlFree(val); 1140 while(cur!=NULL && cur->type != XML_ELEMENT_NODE) 1141 cur=cur->next; 1142 } 1143 } 1094 1144 } 1095 1145
Note: See TracChangeset
for help on using the changeset viewer.