libidav/xml.c

changeset 526
e3c0440bd599
parent 520
da2b0cc44e4f
child 532
aeda47714978
equal deleted inserted replaced
525:26a1d5b9d9d2 526:e3c0440bd599
343 } else { 343 } else {
344 node->attributes = attr; 344 node->attributes = attr;
345 } 345 }
346 } 346 }
347 347
348 char* dav_xml_get_attr(DavXmlNode *node, const char *name) {
349 DavXmlAttr *attr = node->attributes;
350 while(attr) {
351 if(!strcmp(attr->name, name)) {
352 return attr->value;
353 }
354
355 attr = attr->next;
356 }
357 return NULL;
358 }
359
348 DavXmlNode* dav_parse_xml(DavSession *sn, const char *str, size_t len) { 360 DavXmlNode* dav_parse_xml(DavSession *sn, const char *str, size_t len) {
349 xmlDoc *doc = xmlReadMemory(str, len, NULL, NULL, 0); 361 xmlDoc *doc = xmlReadMemory(str, len, NULL, NULL, 0);
350 if(!doc) { 362 if(!doc) {
351 return NULL; 363 return NULL;
352 } 364 }

mercurial