src/server/webdav/xml.c

changeset 490
d218607f5a7e
parent 415
d938228c382e
equal deleted inserted replaced
489:921f83a8943f 490:d218607f5a7e
208 // namespace required for all elements 208 // namespace required for all elements
209 if(node->type == XML_ELEMENT_NODE && node->ns) { 209 if(node->type == XML_ELEMENT_NODE && node->ns) {
210 // we create a list of unique prefix-href namespaces by putting 210 // we create a list of unique prefix-href namespaces by putting
211 // all namespaces in a map 211 // all namespaces in a map
212 CxHashKey nskey = xml_namespace_key(col->a, node->ns); 212 CxHashKey nskey = xml_namespace_key(col->a, node->ns);
213 if(!nskey.data.bytes) { 213 if(!nskey.data) {
214 col->error = 1; 214 col->error = 1;
215 return 1; 215 return 1;
216 } 216 }
217 if(cxMapPut(col->nsmap, nskey, node->ns)) { 217 if(cxMapPut(col->nsmap, nskey, node->ns)) {
218 col->error = 1; 218 col->error = 1;
255 int *error) 255 int *error)
256 { 256 {
257 if(error) *error = 0; 257 if(error) *error = 0;
258 258
259 CxAllocator *a = pool_allocator(pool); 259 CxAllocator *a = pool_allocator(pool);
260 CxMap *nsmap = cxHashMapCreate(a, 16); 260 CxMap *nsmap = cxHashMapCreate(a, CX_STORE_POINTERS, 16);
261 if(!nsmap) { 261 if(!nsmap) {
262 if(error) *error = 1; 262 if(error) *error = 1;
263 return NULL; 263 return NULL;
264 } 264 }
265 265
279 // remove all namespace definitions from the map 279 // remove all namespace definitions from the map
280 // what we get is a map that contains all missing namespace definitions 280 // what we get is a map that contains all missing namespace definitions
281 WebdavNSList *def = col.def; 281 WebdavNSList *def = col.def;
282 while(def) { 282 while(def) {
283 CxHashKey nskey = xml_namespace_key(a, def->namespace); 283 CxHashKey nskey = xml_namespace_key(a, def->namespace);
284 if(!nskey.data.bytes) { 284 if(!nskey.data) {
285 if(error) *error = 1; 285 if(error) *error = 1;
286 break; 286 break;
287 } 287 }
288 (void)cxMapRemove(nsmap, nskey); 288 cxMapRemove(nsmap, nskey);
289 def = def->next; 289 def = def->next;
290 } 290 }
291 291
292 // convert nsmap to a list 292 // convert nsmap to a list
293 CxIterator i = cxMapIteratorValues(nsmap); 293 CxIterator i = cxMapIteratorValues(nsmap);

mercurial